[ I 
posted<http://stackoverflow.com/questions/12722794/remote-service-killed-while-main-process-bound-to-it>this
 on StackOverflow a few days ago but didn't get an answer to the main 
issue (only a workaround) ]

On my Galaxy Nexus with Jelly Bean 4.1.1 (official) sometimes the OS goes 
on a killing spree and the log has these kinds of entries:

10-02 22:24:34.992 I/ActivityManager(  306): Killing 
> 7517:com.google.android.apps.reader/u0a77: remove task
> 10-02 22:24:36.484 I/ActivityManager(  306): Killing 
> 7465:com.tf.thinkdroid.sg:writedroid/u0a50: remove task
> 10-02 22:24:37.273 I/ActivityManager(  306): Killing 
> 5924:com.metago.astro/u0a73: remove task
> 10-02 22:24:37.296 W/ActivityManager(  306): Scheduling restart of crashed 
> service com.metago.astro/.jobs.JobService in 5000ms
> 10-02 22:24:37.656 I/ActivityManager(  306): Killing 
> 7302:org.jtb.alogcat/u0a84: remove task
> 10-02 22:24:38.148 I/ActivityManager(  306): Killing 
> 7120:com.google.android.gm/u0a19: remove task


Unfortunately one of the processes being killed is my remote service that 
has a running app bound to it. Indeed, the service is restarted immediately 
afterwards but this causes inconsistent behavior in my app.

In Service 
Lifecycle<https://developer.android.com/reference/android/app/Service.html#ServiceLifecycle>it
 says:
 

> A service can be both started and have connections bound to it. In such a 
> case, the system will keep the service running as long as either it is 
> started or there are one or more connections to it with the 
> Context.BIND_AUTO_CREATE flag.


My app binds to the remote service with Context.BIND_AUTO_CREATE so I was 
under the impression that the remote service will stay up as long as the 
main process is bound to it. How can I make Android not kill the remote 
service?

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