Is there a way to to receive a broadcast(System broadcast,may be) in android as soon as user of the phone sets an Alarm?
I googled this and most of the discussion on stackoveflow seems to be around how to check if alarm is already set using AlarmManager
class and how this can or cannot be done etc.
I guess my requirement is little different, because I want to register a BroadcastReciver
through my app, which should be notified as soon as user sets an Alarm. Even if user sets multiple alarm, my app should be notified for each alarm, set by the user.
I am also ok for any other way beside BroadcastReciver
too for this, if one exist in Android.
Update: I tried android.app.action.NEXT_ALARM_CLOCK_CHANGED
with my BroadcastReceiver after the suggestion from PeterChaula and it worked. But that this ACTION_NEXT_ALARM_CLOCK_CHANGED
was introduced in API Level 21 and my app needs to support minSdkVersion
of 14 and above.