List Alarms in Android
1 min read

List Alarms in Android

List Alarms in Android

The other day I thought it would be a good idea to list set alarms in android, so I whipped up the following code:

private void listAlarms() {
    for (AlarmManager.AlarmClockInfo aci = mAlarmManager.getNextAlarmClock();
          aci != null;
          aci = mAlarmManager.getNextAlarmClock()) {
        Log.d(TAG, aci.getShowIntent().toString());
        Log.d(TAG, String.format("Trigger time: %d", aci.getTriggerTime()));

Its idea is that we iterate through the alarm clocks set by the AlarmManager.

This works quite OK, but it doesn't show periodic alarms :(, so it's of no immediate use to me.

Therefore, I place it here in case someone finds this useful.