美文网首页
CountDownTimer实现倒计时

CountDownTimer实现倒计时

作者: ink9979 | 来源:发表于2017-08-28 09:48 被阅读0次

private TimeCount time;

time=newTimeCount(60000,1000); 

private classTimeCountextendsCountDownTimer {

publicTimeCount(longmillisInFuture,longcountDownInterval) {

super(millisInFuture, countDownInterval);

//TODO Auto-generated constructor stub

}

@Override

public voidonTick(longmillisUntilFinished) {

//TODO Auto-generated method stub

tv_huoquyanzheng.setClickable(false);// 防止重复点击

tv_huoquyanzheng.setTextColor(0xFF444444);

tv_huoquyanzheng

.setText(millisUntilFinished /1000+"s"+"后再次发送");

}

@Override

public voidonFinish() {

tv_huoquyanzheng.setText("获取验证码");

tv_huoquyanzheng.setTextColor(0xFFac0000);

tv_huoquyanzheng.setClickable(true);

}

}

相关文章

网友评论

      本文标题:CountDownTimer实现倒计时

      本文链接:https://www.haomeiwen.com/subject/mwywdxtx.html