您的位置:首页 > 其它

alarmmanager 定期操作未生效

2016-01-14 14:25 288 查看
参看:http://msdx.github.io/androiddoc/docs/reference/android/app/AlarmManager.html

Note: Beginning with API 19 (
KITKAT
)
alarm delivery is inexact: the OS will shift alarms in order to minimize wakeups and battery use. There are new APIs to support applications which need strict delivery guarantees; see 
setWindow(int,
long, long, PendingIntent)
 and 
setExact(int,
long, PendingIntent)
. Applications whose
targetSdkVersion
 is
earlier than API 19 will continue to see the previous behavior in which all alarms are delivered exactly when requested.

原来用的是 set(RTC_WAKEUP..) 没能把手机唤醒。

现在改用


public void setExact (int type, long triggerAtMillis, PendingIntent operation)

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: