Implement stop and snooze for Android alarm

I hope to set the Android alarm clock for two time intervals every day, for example, from 8:00 to 9:00, from 12:00 to 13:00. For each period of time, it fluctuates every 5 minutes. When you click "snooze", it ends the current activity and rings the next time interval (after 5 minutes); when you click "stop" ends the current activity and rings in the next period of time (until the beginning of 12 pm-13 pm).

I am finishing the β€œdelay”, but I did not understand how to go to the next period of time to β€œstop”. How can I pass the return value when I press the button so that AlarmManager can recognize the difference and cancel the next signal?

Thanks for the help!

+4
source share

Source: https://habr.com/ru/post/1397307/


All Articles