Android CountDownTimer

When recording:

CountDownTimer timer = new CountDownTimer(1000, 100) { @Override public void onTick(long l) { } @Override public void onFinish() { }; }.start(); 

Are we really launching a new thread that processes ticks? If not, what is really happening?

+6
android countdowntimer
source share
2 answers

CountDownTimer implementation uses Handler and sendMessageDelayed() , so no background thread is needed. This means that the timer will not be updated if you link the main application thread elsewhere in your code.

+11
source share

Definition from several publications, verified and verified:

"Another timer has the built-in CountTowner class . It encapsulates the creation of the background thread and the handler sequence in a convenient class call ..."

+1
source share

All Articles