【发布时间】:2016-03-15 21:15:04
【问题描述】:
我在回合结束后设置暂停时遇到问题。当用户单击按钮时,它开始倒计时,当完成的文本返回到我想要的值时。但我希望在倒计时(计时器)完成时启动另一个 timer2。现在它同时开始计数。每个计时器在屏幕上都有自己的 textView。 这是代码:
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
long roundtime= Long.parseLong(String.valueOf(msg1))*1000; //User set Time for Round
long pause= Long.parseLong(String.valueOf(msg2))*1000; //User set Time for Pause
Counting timer = new Counting(roundtime, 1000); // class CountdownTimer
Counting2 timer2 = new Counting2(pause, 1000); // class CountdownTimer
timer.start(); // I want to start with this timer first
timer2.start(); // And when timer is finished start with this in own textView
}
【问题讨论】: