在Android的动作TIME_SET获取调用很多次,而无需手动更改时间 [英] Action TIME_SET in android getting called many times without changing the time manually

查看:3037
本文介绍了在Android的动作TIME_SET获取调用很多次,而无需手动更改时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个接收器监听TIME_SET操作机器人。

但有些时候我得到的意图的动作不改变时间(随机问题)

请帮我解决这个问题。

在此先感谢。 code

 <接收器
        机器人:名称=。tamperprooftime.TimeChangedReceiver
        机器人:出口=假>
        <意向滤光器>
            <作用机器人:名称=android.intent.action.TIME_SET/>
            <作用机器人:名称=android.intent.action.TIMEZONE_CHANGED/>
        &所述; /意图滤光器>
    < /接收器>
 

解决方案

我也有同样的问题。看来,如果您的设备具有使用网络提供的时间检查设备将定期更新的时间。好像如果时间为最小时间更正TIME_SET广播会发生,即使更新......我希望有使用,可以检查一些阈值参数/让这些小的时候更正广播,或发现有不同的广播为当用户明确地改变了对设备进行修正自己的时间。

I have a receiver which listens to the TIME_SET action android.

but some times am getting intent action without changing the time (random issue)

please help me in solving this issue

Thanks in advance. code

    <receiver
        android:name=".tamperprooftime.TimeChangedReceiver"
        android:exported="false" >
        <intent-filter>
            <action android:name="android.intent.action.TIME_SET" />
            <action android:name="android.intent.action.TIMEZONE_CHANGED" />
        </intent-filter>
    </receiver>

解决方案

I also had this same issue. It appears that if your device has the "Use network provided time" checked the device will periodically update the time. It seems like if the time is updated even for the smallest of time corrections the TIME_SET broadcast will happen... I wish that there was some threshold parameter that could be checked/used so that these minor time corrections are broadcast, or that there was a different broadcast for when the user explicitly changed the time versus the device was correcting itself.

这篇关于在Android的动作TIME_SET获取调用很多次,而无需手动更改时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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