自己定义CountDownTimer

/** * 计时器 * @author Administrator * */class TimeCount extends CountDownTimer{public TimeCount(long millisInFuture, long countDownInterval) {super(millisInFuture, countDownInterval);}@Overridepublic void onFinish() {}@Overridepublic void onTick(long millisUntilFinished) {//计时显示if(millisUntilFinished/1000-1==0){//倒计时技术在handler中进行处理}tv_time.setText((millisUntilFinished/1000-1)+"s");//倒计时的时间显示}}


调用


private TimeCount time;//计时器time=new TimeCount(60000,1000);//開始计时time.start();


更多相关文章

  1. Android中自定义View支持缩放
  2. android 自定义dialog弹出和消失缩放动画
  3. Android 自定义日期控件,包含月控件
  4. Android UI - 带白边的自定义ImageView效果
  5. Android 自定义BaseAdapter
  6. 自定义Android Progress Bar的颜色

随机推荐

  1. android 4.0 HttpURLConnection. getInpu
  2. Android(安卓)webview 图片大小完美适配
  3. android本地分享
  4. phonegap hardwareAccelerated问题
  5. app安装位置声明
  6. Android(安卓)每隔3s更新一次title
  7. Android(安卓)HOME键的屏蔽
  8. android 中RectF构造函数参数说明
  9. Android之获取移动网络ip
  10. Android注解式绑定控件BindView