On my Galaxy Nexus with Bean 4.1.1 jelly (official), sometimes the OS goes into a hurricane boom, and the journal has the following 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 to be killed is my remote service, to which a working application is bound. Indeed, the service starts immediately after that, but this causes inconsistent behavior in my application.
In the service life cycle , it says:
A service can be started and associated with it. In this case, the system will support the service until either it is running, or there is one or more connections to it using the Context.BIND_AUTO_CREATE flag.
My application is bound to a remote service using Context.BIND_AUTO_CREATE , so it seemed to me that the remote service would not work while the main process was attached to it. How can I get Android to not kill a remote service?
NOTE. The bounty explains why the code does not seem to work as per the documentation.
source share