如何在Android"高级任务杀手锏"工作?
我提出一个应用程序,允许用户根据GPS位置设置警报。我有我删除创建的通知和我设置了报警的问题。
I am making an app that allows the user to set an alarm based on GPS locations. I am having problems deleting the notifications I create and the alarms I set.
我发现,所有的通知和警报被永久删除时,我使用高级任务杀手锏。我想实现什么它确实为我的应用程序。有谁知道这是什么应用程序做和/或在哪里可以找到源头code?
I have found that all the notifications and alarms are deleted permanently when I use the "Advanced Task Killer App". I want to implement whatever it does into my app. Does anyone know what this app does and/or where I can find the source code?
先谢谢了。
你有没有尝试用一个整数ID来发表您的通知?
像这样,
Did you try to post your notification with an integer ID? Like so,
通知(MY_NOTE_ID,通知);
如果是这样的话,你可以简单地得到通知经理致电取消它们。
If that's the case, you can simply get the notification manager to cancel them by calling
取消(MY_NOTE_ID);
此外,请务必使用标志,如 Notification.FLAG_ONGOING_EVENT
和 Notification.FLAG_AUTO_CANCEL
恰如其分。正在进行的标志,使通知没有显示在持续的部分,自动取消标志,可以确保当你点击就可以了通知消失。
Also, make sure to use flags such as Notification.FLAG_ONGOING_EVENT
and Notification.FLAG_AUTO_CANCEL
appropriately. The ongoing flag makes the notification show up in on-going section, and auto cancel flag ensures the notification disappears when you click on it.