Android AlarmManager:有没有办法取消所有设置的警报? [英] Android AlarmManager: is there a way to cancell ALL the alarms set?
问题描述
我正在构建一个应用程序,该应用程序在一周中的每一天(在特定的小时和分钟)设置2个警报,警报会永远每周重复。
I am building an app that set 2 alarms for each day of the week (at a certain hour and minute), the alarms repeat week after week forever.
现在的要点是:如果用户更改了警报,我将需要取消先前设置的警报。
Now the point is: if the user changes the alarms, I will need cancel the previously set alarms.
有没有一种方法可以简单地取消应用程序设置的所有警报?
Is there a way to simply cancel all the alarms set by my application ?
推荐答案
我认为您可以关注一下: AlarmManager.Cancel
I think you could get an eye on : AlarmManager.Cancel
关于该问题/答案: Android:使用AlarmManager设置所有PendingIntents
如其中所述,您不能要求AlarmManager告诉您其中包含什么PendingIntent。但我认为您可以使一些PendingIntent与您要取消的PendingIntent相似;)。
As stated in there you can't ask to the AlarmManager to tell you what PendingIntent are in it. But I think you can make some PendingIntent similar to the one you want to cancel ;).
这篇关于Android AlarmManager:有没有办法取消所有设置的警报?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!