Android CountDownTimer

后端 未结 2 1914
野性不改
野性不改 2021-01-12 23:50

When writing :

 CountDownTimer timer = new CountDownTimer(1000, 100) 
 {
      @Override
       public void onTick(long l) 
       {

       }

       @Overr         


        
2条回答
  •  感情败类
    2021-01-13 00:21

    CountDownTimer's implementation uses Handler and sendMessageDelayed(), so no background thread is needed. This does mean that the timer will not update if you are tying up the main application thread elsewhere in your code.

提交回复
热议问题