Question

I got a geolocation service. When force killed using some Task Killing apps, in the 'Manage Application' -> Running tab my App is showing as 0 Process and 1 service, and status is Restarting, but not getting restarted.

public int onStartCommand(Intent intent, int flags, int startId) {
    return START_REDELIVER_INTENT;
}

I started my service using

startService(new Intent(this, MyService.class));

Is there any way to restart the process?

Était-ce utile?

La solution

Use

return START_STICKY

instead.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top