(Source code introduction:
Application platform: Android;
Application case: purchase a large number of goods within a limited time, etc
Like this countdown, I don't know if you have encountered it. What solutions can you think of??????
1. Fetch data from the server every second?
2. Cycle a handler every second and refresh the time control of each handler?
3. Do you have any other ideas?
None of the above options are desirable:
1. There is time lag in the network connection, and the server cannot withstand a large amount of data access.
2. Loop traversal is feasible, but when the amount of data is very small, if the amount of data is too large, there will be problems of card screen and high system memory occupation.
The solution of this source code is to encapsulate digital clock in Android system once.
By inheriting the following methods and changing the internal implementation.)