to know next alarm time using setRepeating() method

时间:2017-12-18 06:49:50

标签: android alarmmanager android-pendingintent alarm

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.

(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

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

Thanks in Advance!

1 个答案:

答案 0 :(得分:0)

正如我在另一个问题中所说,您无法从AlarmManager获取此信息。您需要将自己的信息存储在SharedPreferences中,以便以后可以参考。

例如,每当闹钟响起时,您都可以更新SharedPreferences以指示下次重复的发生时间。