Android 小部件的 updatePeriodMillis 的最大值是多少?
我的应用程序中有一个小部件,只需在服务运行时更新,其他时间不需要更新。我想让 Android 不更新它,或者最坏的情况下,只以非常大的间隔更新它。
换句话说,我可以定义 android:updatePeriodMillis 的最大值是多少?
我似乎无法在任何地方找到此信息...
I have a widget in my app that only needs to be updated when a service is running, and at no other time. I would like to get Android to not update it, or, at-worst, only update it at very large intervals.
In other words, what is the maximum value I can define android:updatePeriodMillis
as?
I can't seem to find this information anywhere...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
updatePeriodMillis 是一个整数。因此,最大值为 Integer.MAX_VALUE,即 2147483647(24 天半左右)。
话虽这么说,听起来好像您不想要自动更新。如果是这种情况,那么文档表示您应该将 updatePeriodMillis 设置为 0 或将其保留在清单中(另请参阅 禁用更新周期
updatePeriodMillis is an integer. So, the max value is Integer.MAX_VALUE which is 2147483647 (24 and a half days or so).
That being said, it sounds as if you want no automatic updates. If that is the case, then the documentation says you should set updatePeriodMillis to 0 or just leave it out of your manifest (also see disable update period
AppWigdet 每 30 分钟更新次数不会超过 2 次。因此,您可以将其设置为您想要的长或短。只要您牢记
注意:通过 updatePeriodMillis 请求的更新每 30 分钟传送的次数不会超过一次。
an AppWigdet wont update any more than 2 times per 30 minutes. So you can set it to however long or short you want it. As long as you keep it mind
Note: Updates requested with updatePeriodMillis will not be delivered more than once every 30 minutes.