AlarmManager,手机休眠时不调用闹钟
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
long schedualed = getNextSchedualTime(context);
alarmManager.set(AlarmManager.RTC, schedualed, makeControlPendingIntent(context));
我知道即使手机处于睡眠状态,设置RTC_WAKEUP
也会运行。但我想知道当手机休眠时,应该在休眠时间触发的RTC
闹钟是否会延迟到手机唤醒时触发?
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
long schedualed = getNextSchedualTime(context);
alarmManager.set(AlarmManager.RTC, schedualed, makeControlPendingIntent(context));
I know to set RTC_WAKEUP
would run even if phone is sleep. But I want to know when the phone is asleep, would the RTC
alarm which should be triggered in the sleeping time be delayed to when the phone wake up?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自官方文档此处:
所以回答你的问题:是的,会延迟,不会掉线。
From official documentation here:
So answer to your question: yes, it will be delayed and will not be dropped.