I use AlarmManager to issue local notifications to user. But if I kill my application using Settings->Apps->Stop, alarm manager seems to be destroyed and all the notification icons disappears from status bar.

It it normal? The idea of local notifications is to persuade user to start my great app if it's closed. And it seems odd for me that they are being wiped out if I kill the app.

有帮助吗?

解决方案

If you KILL your application you also kill the AlarmManager. There is nothing odd about it. You close the app by pressing the home button, not by killing it via the settings.

其他提示

Use service to set AlarmManager and notification.

Also keep in mind that once device is restarted Alarm is cancelled.

So you will need to set broadcast receiver.

look at this Click here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top