CountDownTimer in android - how to restart it

后端 未结 5 1382
攒了一身酷
攒了一身酷 2021-01-04 03:26

I to restart a CountDownTimer. I read a lot of question here but no one of the answer helped me. When I use the following code

if(Const.counter != null){
            


        
5条回答
  •  鱼传尺愫
    2021-01-04 04:23

    I did some different trick here. Hope this will help you.

    if (myCountDownTimer != null) {
                myCountDownTimer.cancel();
            }
            myCountDownTimer = new MyCountDownTimer(10000, 500);
            myCountDownTimer.start();
    

提交回复
热议问题