private CountDownTimer mc;//计时器private void showtime() { mc = new CountDownTimer(60000, 1000) { public void onTick(long millisUntilFinished) { tell_code.setText("重新发送("+Utils.formatDuring(millisUntilFinished)+")"); tell_code.setTextColor(getResources().getColor(R.color.font_333)); tell_code.setClickable(false); } public void onFinish() { //倒计时完成以后 执行的语句 tell_code.setText("获取验证码"); if (username.getText().length()==11){ tell_code.setTextColor(getResources().getColor(R.color.order_btn)); tell_code.setClickable(true); }else{ tell_code.setTextColor(getResources().getColor(R.color.hui)); tell_code.setClickable(false); } } }.start(); }
android 倒计时
最新推荐文章于 2016-03-04 09:15:36 发布