Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要弄清楚是否重新启动该警报,因为它是一个定时服务器轮询,但应该只有一个警报实例。
要回答您的问题:
更新您的应用程序对本地存储的数据、数据库、 PendingIntents、通知、计划警报AlarmManager等没有任何作用。如果您在更新应用程序时有未决警报,它们仍将在安装更新后的应用程序后的通常/适当时间触发.
PendingIntent
AlarmManager
但是,如果您觉得有必要,您可以随时重置闹钟。使用 设置警报AlarmManager将丢弃任何先前设置的具有匹配的警报PendingIntent。如果您始终使用相同的参数,PendingIntent那么您将永远不会安排超过一个警报。