Saturday, May 24, 2014

[android-developers] Keeping a service running..

I've got a service that I'd like to be active in the background.

But when I delete the associated app from the Android recently used
list - it kills the service also. I assume because it's running in the
same process. Though I do not get the service.onDestroy() call.

Any way to prevent this.

In the main activity onCreate()

I call startService(). I want it to start the service if it's not already
started. Then I bind to it.

In the service, I return onStartCommand() with START_STICKY


So shouldn't the service not be killed with the above setup.

--
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+unsubscribe@googlegroups.com
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 android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment