AlarmManager.RTC做唤醒太多的更新 [英] AlarmManager.RTC doing too many updates on wakeup

查看:220
本文介绍了AlarmManager.RTC做唤醒太多的更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经得到了我运行​​通过 AlarmManager.RTC 每30分钟的服务。如果该设备是睡够长,被称为两次服务(因此他们都被rescsheduled),当它被唤醒时,在两次火灾后关闭服务。

I've got a service that I run every 30 minutes via AlarmManager.RTC. If the device is asleep long enough for the service to be called twice (and thus have both of them be rescsheduled), when it wakes up, it fires off the service twice at once.

所需的行为方式是 AlarmManager 只是火了有一个意图,当它醒来。我怎样才能做到这一点?

The desired behavior is for the AlarmManager to just fire off one Intent when it wakes up. How can I accomplish this?

推荐答案

试试这个:

PendingIntent.FLAG_UPDATE_CURRENT

这篇关于AlarmManager.RTC做唤醒太多的更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆