I am developing an application for a certain event like a count down.
In the foreground of the app I show the days, hours, minutes and seconds left till the event date/time with handler.
However, I'd like to be able to detect start of new day (when app is in background) and show a notification in the status bar like '29 days left'. I want to receive this event whenever the system date automatically changes to new day (23:59 -> 00:00) everyday until the end date of my event.
Having said all this, how can I achieve this with the AlarmManager (or any other way)?
I know how to set up broadcast receivers, I just don't know how to schedule the event to occur precisely when a new day has come.