Note: The Alarm Manager is intended for cases where you want to have your application code run at a specific time, even if your application is not currently running
So in my view the Alarm Manager shall be used to wake your program up at a specific time.
You could do the following if the user selected more than one program to be notified of:
- Get the earliest one and set the Alarm Manager to wake program up on that time.
- Then internally work with Handler as long as Program is running
- If program is sent to background (would probably be onFreeze() or sth.), repeat step 1.
Thats how I would do it.
The Handler-Class also provides a method postAtTime (probably only works if application is running!):
postAtTime(Runnable r, long uptimeMillis)
Causes the Runnable r to be added to the message queue, to be run at a specific time given by uptimeMillis.
Hope I could help you.