开发者

android - get time of the next alarm

Is there a way in Android to get the upcoming al开发者_开发百科arm time?

Thanks

Clarification: I am talking about the native android Alarm Clock appliction


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()


String nextAlarm = Settings.System.getString(getContentResolver(),
    Settings.System.NEXT_ALARM_FORMATTED);


Needs to be:

String nextAlarm = android.provider.Settings.System.getString(getContentResolver(), android.provider.Settings.System.NEXT_ALARM_FORMATTED);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜