Domanda

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?

È stato utile?

Soluzione

Use

return START_STICKY

instead.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top