In the development of TV system, the analog source (ATV/DTV) is often used. Recently found in the test, in the DTV source, a timed timer timer suddenly paused, Baidu this timer, most of the question is how to stop the timer run, and did not mention how to let him not stop, embarrassed.
After struggling for a period of time, the test found in the DTV source will appear the bug, and in other sources do not appear, inference is related to DTV source. In the digital TV is a big feature is that basically will take DTV stream time to write to the system time, to ensure that the system time and code flow time consistent. Here may be a lot of people think of, that is the timer of the characteristics of the class itself--timer timing is the absolute time, in short, is related to the system time, once the system time changes, it is likely to affect the timing of the timer- If the time in DTV stream is inconsistent with the time of the system itself, then it is conceivable that the timing of the timer will be wrong because the time of the code stream is written to the system. In the test source, the stream information is often incorrect, and the current system time (generally will be network acquisition time) certainly inconsistent, if the acquisition of this time is a day ago, one months ago or even a year ago, the timer has been the illusion of being terminated-in fact, it has been running just the timing of chaos.
The solution is very simple, use based on the relative time of the class Scheduledexecutorservice can be ~ specific usage can own Baidu, the class and system time does not hook, so you can use, It is said that in the high version of the SDK, this class has completely replaced the status of the timer, even the usage is basically consistent.
The influence of DTV stream on the timer of Android in TV