究竟是不精确setInexactRepeating()为AlarmManager? [英] Just how inexact is setInexactRepeating() for AlarmManager?

查看:165
本文介绍了究竟是不精确setInexactRepeating()为AlarmManager?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已经被问过,<一个href=\"http://stackoverflow.com/questions/7129282/how-inexact-is-setinexactrepeating-for-alarmmanager\">here,但给出的答案是指文件实际上是令人难以置信的暧昧。它说不精确报警可能出现在指定的时间后,几乎是满间隔。对于有一整天的时间间隔报警,这似乎过分了。

I know this question has been asked before, here, but the answer given refers to documentation which is actually incredibly ambiguous. It says the inexact alarm might occur almost a "full interval" after the specified time. For alarms with an interval of a whole day, this would seem excessive.

文档不说这里(RTC示例下)您可以使用不精确重复日常报警,并给出了一个精确闹钟被设置为大约下午2的一个例子。没有人在他们的脑子会想大约下午2可能意味着下午1点,第二天,所以它似乎并不可能每天的报警至少可以几乎整整间隔指定的时间后。

The documentation does say here (under "RTC examples") that you can use inexact repeating for daily alarms, and gives an example of an inexact alarm being set for "approximately 2pm". Nobody in their right mind would think "approximately 2pm" might mean 1pm the next day, so it doesn't seem likely daily alarms at least can be "almost a full interval" after the specified time.

是否有任何明确的信息在那里大约有多么晚每日间隔不精确的警报可能是什么?谢谢你。

Is there any definite info out there about just how late an inexact alarm with a daily interval might be? Thanks.

(我知道API 19具有setWindow但我想我的应用程序在旧的API的工作太)。

(I know API 19 has "setWindow" but I'd like my app to work on older APIs too).

推荐答案

我已经连续5报警和平均延迟测​​试这一点,我的手机上,为11.8分钟。这与设置为INTERVAL_DAY重复之间的间隔。

I've tested this with 5 consecutive alarms and the average delay, on my phone, was 11.8 minutes. This was with the interval between repeats set to INTERVAL_DAY.

这篇关于究竟是不精确setInexactRepeating()为AlarmManager?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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