等待倒计时结束

Waiting for a countdowntimer to finish

我在编写代码方面需要帮助,

如何编写代码以等待倒计时结束?

我尝试使用布尔值表示倒数计时器是否为 运行,在代码中,它是这样的:

---part 1 of code---

While(running){}

---part2 of the code---

它使屏幕冻结...不知道如何解决这个问题..帮助某人?

CountDownTimer 已经有了,你只需要在 onFinish() 中放置你想让它们在计时器结束后工作的代码,如下所示

 countDownTimer = new CountDownTimer(10000, 1000) {
        @Override
        public void onTick(long l) {

        }

        @Override
        public void onFinish() {
          //this part will work after timer have finished
        }
    }.start();