On Thu, May 28, 2009 at 7:12 AM, Mike Hearn <[email protected]> wrote:

>
> Your understanding is wrong - your service can be killed at any time
> without onDestroy being run. I'm not actually sure why onDestroy even
> exists in this case, I found it was much more common for the kernel to
> OOM kill my process than it was for the AM to nicely request my
> service to quit. Don't save state in onDestroy, if you need to,
> checkpoint state in the service. It'll just be tears in the long run
> if you don't.


It depends on how you use your service. If you call startService() and then
never stop the service again, then yes, eventually that process will
probably just be killed.
If you do stop the service when it is no longer needed, then onDestroy()
will be called shortly thereafter.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to