您的位置:首页 > 其它

使用CountDownTimer实现倒计时功能

2014-03-27 11:32 483 查看
// 倒计时60s
new CountDownTimer(60000, 1000) {

@Override
public void onTick(long millisUntilFinished) {
mReGetAuthCodeButton
.setText(getString(R.string.tip_get_code_time,
millisUntilFinished / 1000));

}

@Override
public void onFinish() {
mBackAble = true;
mReGetAuthCodeButton
.setBackgroundResource(R.drawable.blue_button_selector);
mReGetAuthCodeButton.setText(R.string.re_get_code);
}
}.start();


之前使用handler thread实现,发现非常影响其它view的响应,改为这个很好。
http://blog.csdn.net/yuanjh2001/article/details/6075315
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: