I think your analysis is correct. I also think it happens because my service doesn't create a worker thread.
In the onStartCommand() method - it sets up some system listeners and returns STICKY. So when the main app is being killed (when i remove it from the active apps list) - i think the service is being killed - but the onDestroy is not being called (as you mentioned). I verified with the ps command - and it's gone. So should I create a worker thread or a handler - i will use it later on for some work. On Friday, January 31, 2014 3:01:28 PM UTC-5, Kostya Vasilyev wrote: > > > 2014-01-31 dashman <[email protected] <javascript:>>: > >> >> What's confusing is this. >> >> I've got the app and service running. >> >> Then using the active app-list option of the launcher, I remove the app. >> >> >> I would think this would kill the app - but not the service. >> >> Service.onDestroy() is not called. >> >> >> But now if I restart the app - the Service.onCreate() is called >> >> > Sounds like your app's process gets killed. When this happens, the > service's onDestroy will not be called. > > Next when you start the app's UI (activity), the process is created again, > and the service is too. > > You can watch this in the logcat, and for more details, use system > settings -> apps -> running, or "adb shell ps", where "ps" is the standard > Unix command that gives the list of running processes. > > -- K > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

