No call to onStartCommand() follows the restart of a crashed service in Android 2.3

I have a problem with Android service restart. I am building against API version 7 and running on a device with Android 2.3.3.

The problem is, that when my service is killed by the system and is later restarted, only the onCreate() of my service is called. code in onStartCommand() is not executed. If I start my application for the first time, the code in onStartCommand() is normally executed and all works fine, until system kills my service, then the service will not restart correctly.

Documentation says that onStartCommand() is always called when a service is restarted. In the case of service restart, the onStartCommand() should be called with null intent. This is not my case.

Any idea why this could happen?

9
задан Flow 4 September 2013 в 21:37
поделиться