android 用CountDownTimer实现一个倒计时
来源:互联网 发布:淘宝批量编辑宝贝描述 编辑:程序博客网 时间:2024/06/05 18:55
public class MainActivity extends Activity { private MyCount mCount; private Button btn_getVc; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); btn_getVc = (Button) findViewById(R.id.reg_getvc_btn); mCount = new MyCount(180000, 1000); mCount.start(); } /*** 省略部分代码... */ /** * 定义一个倒计时的内部类 */ class MyCount extends CountDownTimer { public MyCount(long millisInFuture, long countDownInterval) { super(millisInFuture, countDownInterval); } @Override public void onFinish() { btn_getVc.setText("获取验证码"); btn_getVc.setEnabled(true); } @Override public void onTick(long millisUntilFinished) { btn_getVc.setText("重新获取(" + millisUntilFinished / 1000 + "秒)"); btn_getVc.setEnabled(false); } } @Override protected void onDestroy() { super.onDestroy(); mCount.cancel(); }}
方法中文说明:http://www.cnblogs.com/over140/archive/2011/12/20/2294220.html
0 0
- android 用CountDownTimer实现一个倒计时
- Android CountDownTimer 倒计时实现
- Android 使用CountDownTimer实现倒计时
- Android 简单实现倒计时CountDownTimer
- Android 定时器+倒计时 CountDownTimer实现
- Android CountDownTimer 实现倒计时功能
- CountDownTimer---android倒计时功能的实现(CountDownTimer)
- android倒计时功能的实现(CountDownTimer)
- Android利用CountDownTimer类实现倒计时功能
- Android实现倒计时之使用CountDownTimer
- android倒计时功能的实现(CountDownTimer)
- android倒计时功能的实现(CountDownTimer)
- android倒计时功能的实现(CountDownTimer)
- android倒计时功能的实现(CountDownTimer)
- Android 使用CountDownTimer实现倒计时动画
- android倒计时功能的实现(CountDownTimer)
- Android使用CountDownTimer实现倒计时功能
- Android倒计时功能的实现(CountDownTimer)
- Android智能问答机器人
- php生成图片缩略图类(支持常用图片格式)
- php获取select中的值
- 学习Python:Mixin 扫盲班
- viewpager左右循环滑动,自动滑动广告栏
- android 用CountDownTimer实现一个倒计时
- [iOS] 多图片选择
- PLSQL Developer 登陆记住密码
- 10中技巧提升Android运行效果
- 关于python装各种工具包的问题
- 学习Python:Mix-in技术介绍
- IOS 30多个iOS常用动画,带详细注释
- hive中UDF和UDAF使用说明
- 初始建库SGA该设多大、PGA该设多大的建议