public class CountdownTimerActivity extends Activity {private TimeCount time;private Button checking;@Overrideprotected void onCreate(Bundle savedInstanceState) {// TODO Auto-generated method stubsuper.onCreate(savedInstanceState);setContentView(R.layout.main);time = new TimeCount(60000, 1000);//构造CountDownTimer对象time.start();checking = (Button) findViewById(R.id.button1);checking.setOnClickListener(this);}class TimeCount extends CountDownTimer {public TimeCount(long millisInFuture, long countDownInterval) {super(millisInFuture, countDownInterval);//参数依次为总时长,和计时的时间间隔}@Overridepublic void onFinish() {//计时完毕时触发checking.setText("重新验证");checking.setClickable(true);}@Overridepublic void onTick(long millisUntilFinished){//计时过程显示checking.setClickable(false);checking.setText(millisUntilFinished /1000+"秒");}}