我怎么能倒数到5然后会发生什么?
Ex:活动开始倒计时到5,然后出现祝酒词
答案 0 :(得分:3)
您可以使用CountdownTimer in-build抽象类
来执行此操作 new CountdownTimer(5000, 1000) {
public void onTick(long millisUntilFinished) {
mTextField.setText("seconds remaining: " + millisUntilFinished / 1000);
}
public void onFinish() {
// Now countdown is finished, perform whatever you want
mTextField.setText("done!");
}
}.start();
答案 1 :(得分:2)