android - AlarmManager,手机休眠时不调用闹钟

标签 android alarmmanager

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/

相关文章:

android - 在android中每周重复一次闹钟

java - Android NDK hello-jni 程序在构建时抛出错误

Android PhoneStateListener 在 sleep 模式下不工作

android -/system 文件夹不可装载 : mount: '/system' not in/proc/mounts

android - 具有不同数据的新警报覆盖已设置的警报

android - alarmmanager 中的延迟 .. 当两个警报同时存在时

android - 如何触发react-native应用程序唤醒? (用于报警)

android - 如何使用 Android map API v2 创建自定义形状的位图标记

android - 应用程序关闭时警报不起作用

android - 如何将 AlarmManager 与存储在 SQLite 数据库中的数据一起使用?