I need to start the service in a separate thread. This is because it is accessing a web service, which can take 5-10 seconds, and I do not want to receive ANR. I will also be attached to this service. I found a way to start the service in a separate thread with something like:
Thread t = new Thread(new Runnable() { public void run() {
However, I believe that this only runs the initial code in the new thread, and the service itself works in the main thread. So, how could I run all the code from the service in another thread?
Thanks in advance
Romanp
source share