gpt4 book ai didi

android - 当 App Force Stop 时,在带有 AlarmManager 的 App 中设置的警报被删除

转载 作者:行者123 更新时间:2023-11-29 16:13:33 25 4
gpt4 key购买 nike

我正在尝试使用 AlarmManager 创建一个闹钟,即使设备处于锁定状态,它也能正常工作。

但是当我使用 Settings -> Manege App -> MyApp -> Force Stop 终止应用程序时,我的闹钟会破坏所有设置

所以请告诉我如何在应用程序被强制停止后杀死我的警报设置,它会在通常的时间通知我。

提前致谢...

最佳答案

But when I kill the application using Settings -> Manege App -> MyApp -> Force Stop then my alarm destroys all the settings.

AlaramManager 是始终运行的关键系统服务。如果您的应用程序安排了一些事情并被杀死,那么 AlarmManager 可能会再次启动应用程序(通过 PendingIntent)。

只需检查 this在 StackOverflow 上回答。

关于android - 当 App Force Stop 时,在带有 AlarmManager 的 App 中设置的警报被删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11241794/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com