Skip to content Skip to sidebar Skip to footer

Android - Get Time Of The Next Alarm

Is there a way in Android to get the upcoming alarm time? Thanks Clarification: I am talking about the native android Alarm Clock appliction

Solution 1:

Starting with API level 21 the constant Settings.System.NEXT_ALARM_FORMATTED is deprecated.

Instead, you should use:

AlarmManager.getNextAlarmClock()

https://developer.android.com/reference/android/app/AlarmManager.html#getNextAlarmClock()

Solution 2:

StringnextAlarm= Settings.System.getString(getContentResolver(),
    Settings.System.NEXT_ALARM_FORMATTED);

Solution 3:

Needs to be:

StringnextAlarm= android.provider.Settings.System.getString(getContentResolver(), android.provider.Settings.System.NEXT_ALARM_FORMATTED);

Post a Comment for "Android - Get Time Of The Next Alarm"