Rafael Lima
Rafael Lima

Reputation: 3535

does stopService kills child threads from service

I've an android service that runs in background... it create threads to run is sub-taks

In certain circunstances i do need to restart the service... i'm doing this like:

 stopService(new Intent(this, MyService.class));
 startService(new Intent(this, MyService.class));

my question is, if during the stopService call the service had some sub-tasks running in child threads those threads are killed or keep running?

my app is min api lvl 16 (i dont know if it makes any difference)

Upvotes: 0

Views: 15

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006604

does stopService kills child threads from service

No.

those threads are killed or keep running?

They keep running, until your process is terminated. That might be milliseconds or minutes after your stopService() call.

Upvotes: 1

Related Questions