究竟是不精确setInexactRepeating()为AlarmManager?

编程入门 行业动态 更新时间:2024-10-22 02:38:17
本文介绍了究竟是不精确setInexactRepeating()为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?

本文发布于:2023-11-27 04:22:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636574.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不精确   setInexactRepeating   AlarmManager

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!