我有9:00 AM,1:00 PM,7:00 PM之类的时间,我每天设置3个待处理的意图,这些意图是使用setRepeating()方法递归触发的。
I have times like 9:00 AM, 1:00 PM, 7:00 PM, where I set 3 pending intents that are recursively triggered using setRepeating() method every day.
(这里我将所有这些待处理的意图唯一请求代码保存在本地SQLite数据库中)
(Here I am saving all these pending intents unique request codes in the local SQLite database)
这里,每当触发警报时,我都想知道下一个将要触发并显示给用户的警报
Here, whenever an alarm is triggered I would like to know the next alarm that is going to be triggered and show to user
示例。现在,警报在上午9:00触发,此时我应该向用户显示下一个警报将在1:00 PM触发。 有什么解决方法可以使我获得下一个警报详细信息。
Example.. Now an alarm was triggered at 9:00 AM and at this time I should display the user that the next alarm is going to be triggered at 1:00 PM. Is there any solution that I could get the next alarm details.
希望我能正确传达。如有疑问,请告诉我
Hope I conveyed correctly.If any queries please let me know
谢谢!
推荐答案正如我在另一个问题中所说,您无法获得来自AlarmManager的信息。您需要将信息自己存储在SharedPreferences中,以便以后使用。
As I said in the other question, you cannot get this information from the AlarmManager. You would need to store the information yourself in a SharedPreferences so that you can refer to it later.
例如,每当闹钟响起时,您都可以将SharedPreferences更新为指示下一次重复的时间。
For example, whenever your alarm goes off, you can update the SharedPreferences to indicate when the next repeat should happen.
更多推荐
使用setRepeating()方法知道下一个警报时间
发布评论