此代码由google提供。我希望此代码在后台作为线程运行,并在点击按钮时启动它。我已经尝试了很多次但它不起作用。请帮助我
new CountDownTimer(31000, 1000) {
public void onTick(long millisUntilFinished) {
box2three.setText("00:" + millisUntilFinished / 1000);
}
public void onFinish() {
box2three.setText("Time's up!");
}
}.start();