AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
long schedualed = getNextSchedualTime(context);
alarmManager.set(AlarmManager.RTC, schedualed, makeControlPendingIntent(context));
我知道设置 RTC_WAKEUP
即使手机处于 sleep 状态也会运行。但是我想知道当手机处于 sleep 状态时,应该在 sleep 时间触发的RTC
闹钟会不会延迟到手机唤醒时?
最佳答案
来自官方文档here :
Alarm time in
System.currentTimeMillis()
(wall clock time in UTC). This alarm does not wake the device up; if it goes off while the device is asleep, it will not be delivered until the next time the device wakes up.
所以回答你的问题:是的,会延迟,不会掉线。
关于android - AlarmManager,手机休眠时不调用闹钟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6071425/