문제

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