Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
387 views
in Technique[技术] by (71.8m points)

java - Action TIME_SET in android getting called many times without changing the time manually

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>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...