Hi!

I have a service that polls for data. To indicate this to the user I
have a persistent notification in the statusbar. In some cases when
the device goes low on memory it destroys the service but OnDestroy is
not called. Later when there is available memory OnCreate is called.
Is this normal behavior? I had hoped that OnDestroy would be called to
I could remove the notification in the statusbar. Now the user thinks
that the service is still running, while it has been stopped by the
OS.

In order to restart the polling how do I know that the OnCreate is
really a restart event and not first time creation of the service? I
thought about checking for the presence of the notification in the
statusbar, but I couldn't find a API to check if a notification was
showing or not.

I have not tried "SetForeground" on the service, since the service
isn't that important to the user, but maybe that would minimize the
problem...

-Christer
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to