如果我改变电话的时间,报警经理会做什么?

时间:2016-08-19 18:31:23

标签: android android-intent alarmmanager android-pendingintent android-alarms

我设置了多个闹钟,为了控制它们,我改变了手机的时间。他们会正常工作吗?换句话说,如果我改变手机的时间,闹钟会崩溃吗?

2 个答案:

答案 0 :(得分:1)

这一切都取决于您在报警管理器的设置方法中传递的类型。

如果您使用过ELAPSED_REALTIME或ELAPSED_REALTIME_WAKEUP,则不会触发警报

ELAPSED_REALTIME

Added in API level 1
int ELAPSED_REALTIME
Alarm time in SystemClock.elapsedRealtime() (time since boot, including sleep). 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.

如果您有用户RTC或RTC_WAKEUP,将根据设备时间触发警报

RTC

Added in API level 1
int RTC
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.

答案 1 :(得分:0)

我不知道崩溃是什么意思。但是警报只能识别设备的时间,所以如果你确实改变了你的设备时间,那么它应该反过来。