質問

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?

役に立ちましたか?

解決

Use

return START_STICKY

instead.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top