I know there is a lot of discussion about AlarmClock
and AlarmManager
and how to set alarms, launch apps, etc. However, I am yet to find the perfect answer for the following scenario.
In my Android alarm clock application I'm developing, I want to set an alarm for a specific time, pass in other settings such as what song to play, vibrate, etc.
1) what should I use to do this? AlarmClock
or AlarmManager
?
2) Now, when the alarm goes off at the specified time, how do I tell it to launch my custom Activity? Again the question of AlarmClock
or AlarmManager
.
This custom activity would show the time and have buttons saying "Sleep" or "Snooze" which the user can press (pretty much what happens when an alarm in any other alarm clock app goes off). I don't want to launch my alarm app, ONLY that one screen when the alarm goes off. When the user hits a button, I want to close that custom acitvity and for nothing else related to that app to open. I would like it so that the user can go back to doing whatever they were doing.