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.
我目前正在构建一个笔记应用程序。每个笔记都可以有一个警报来提醒用户该笔记。我想知道我是否在程序中创建了警报,然后在“启动时”重建它。由于笔记应用程序当时不会运行,上下文会有所不同吗?如果我误解了上下文,有人可以向我解释一下吗?
我刚刚发布了我自己的带有提醒功能的 Notes 应用程序,所以你去吧:当设备重新启动时,AlarmManager 会丢失所有已注册的警报。因此,您必须注册您的应用程序以在启动完成时收听系统发送的广播,然后重新添加所有提醒。