Reputation: 4644
I have two services in my app. First Service listens for a broadcast from System. Based on it the first service makes decision whether to start or stop a Second Service. Now my Second service performs some network tasks by starting a separate worker thread.
My question is : when I will stop the 2nd service from 1st service, definitely onDestroy() will be called for 2nd Service, but would it also stop its worker thread or the worker thread will keep going until it finishes ?
Regards.
Upvotes: 0
Views: 132
Reputation: 55350
If you created the Thread
yourself, then no, it won't be stopped automatically. You're responsible for killing it in onDestroy()
.
Upvotes: 2