Search code examples
androidservicegpsalarmmanager

why app service restarting, and not able to restart?


it is a tracking app of 24*7. Whenever it stops i use START_REDELIVER_INTENT to restart it, but it is not start every time. It shows below type response in Application manager. Please suggest.

enter image description here


Solution

  • I just discovered that if the service is killed on on 4.1.1, START_REDELIVER_INTENT can take even 20 minutes to restart the service. The restart always coincides with the next dalvikvm garbage collection. Until then the service is stuck on "Restarting" as shown in the question.

    However START_STICKY restarts the service within seconds of being terminated.