Checking if CountDownTimer is running

前端 未结 3 2024
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 21:36

Ive been looking to see a method to see if a CountDownTimer is running or not, but I cant find a way to, any help would be greatly appreciated

if (position =         


        
3条回答
  •  清酒与你
    2021-01-03 22:08

    onTick is your callback for a running process, you can either set a property to track the status.

    isTimerRunning =false;
    

    After start -> make it true; Inside OnTick -> make it true (not actually required, but a double check) Inside OnFinish -> make it false;

    use the isTimerRunning property to track the status.

提交回复
热议问题