Skip to content Skip to sidebar Skip to footer

Using Alarmmanager, Service Is Not Being Restarted After Application Being Killed?

I have made a simple example where a toast message will be shown after a time gap. I am using alarmmanager for scheduling a service from where the toast message will be shown. Now

Solution 1:

You can actually implement BroadcastReceiver at onDestroy to restart the service once the app/service is close by the system/user.

You can check the post here, and a tutorial for you, check here.

Hope it helps!

Solution 2:

Try with below :-

return Service.START_CONTINUATION_MASK;

Post a Comment for "Using Alarmmanager, Service Is Not Being Restarted After Application Being Killed?"