Android(安卓)开发中的倒计时
16lz
2021-12-04
Android开发中会遇到获取验证码,之后60秒不能在点击,这事需要一个倒计时:下面一种如下
btnVericificationCode.setEnabled(false); new CountDownTimer(59000, 1000) { @Override public void onTick(long l) { btnVericificationCode.setText("已发送:" + l / 1000 + "秒"); } @Override public void onFinish() { btnVericificationCode.setEnabled(true); btnVericificationCode.setText("获取验证码"); } }.start();
更多相关文章
- 【阿里云镜像】切换阿里巴巴开源镜像站镜像——Debian镜像
- [android]在上下文菜单的选中事件中获取列表选中的元素
- [Android]在App中使用相机
- Android获取设备唯一标识完美解决方案
- Gradle多渠道打包
- [APP] Android(安卓)开发笔记 006-使用短信验证SDK进行短信验证
- Android(安卓)5.x特性概览二
- android listview custom style 自定义样式
- Android(安卓)Q 电量使用图分析 show app usage