发送验证码

 1 CountDownTimer countDownTimer = new CountDownTimer(60000,1000) {
 2 
 3         @Override
 4         public void onTick(long millisUntilFinished) {
 5             btn_center_phone_act_Send.setBackgroundColor(mActivity.getResources().getColor(
 6                     R.color.font_light_gray));
 7             btn_center_phone_act_Send.setTextColor(mActivity.getResources().getColor(R.color.white));
 8             btn_center_phone_act_Send.setText("" + millisUntilFinished / 1000 + "秒");
 9             btn_center_phone_act_Send.setClickable(false);
10         }
11 
12         @Override
13         public void onFinish() {
14             btn_center_phone_act_Send.setClickable(true);
15             btn_center_phone_act_Send.setText("重新获取");
16             btn_center_phone_act_Send.setTextColor(mActivity.getResources().getColor(R.color.blue));
17             btn_center_phone_act_Send.setBackgroundResource(R.drawable.textview_square_on_selector);
18         }
19     };

 

countDownTimer.start();

 

posted on 2015-08-27 10:01  大米稀饭  阅读(182)  评论(0编辑  收藏  举报