handler倒计时跳转页
来源:互联网 发布:大数据搜索 编辑:程序博客网 时间:2024/04/30 07:55
这是完整的一段代码 当然其中的按钮还需自己创建引用,希望能帮人帮己
public class MainActivity extends AppCompatActivity { int count = 3; Button btn_skip; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().getDecorView().setSystemUiVisibility(View.GONE);//隐藏状态栏 setContentView(R.layout.activity_main); btn_skip = (Button)findViewById(R.id.btn_skip); btn_skip.setText(count+"s"); Message message = handler.obtainMessage(1); handler.sendMessageDelayed(message,1000); } final Handler handler = new Handler(){ @Override public void handleMessage(Message msg) { switch(msg.what){ case 1: count--; btn_skip.setText(count+"s"); if (count > 0){ Message message = handler.obtainMessage(1); handler.sendMessageDelayed(message,1000); }else{ Intent intent = new Intent(MainActivity.this,Main2Activity.class); startActivity(intent); } } super.handleMessage(msg); } };
阅读全文
0 0
- handler倒计时跳转页
- Handler倒计时跳转1v
- Handler和Timer实现倒计时跳转页面
- 倒计时跳转页
- Android 倒计时跳转页面之handler的详细运用
- Handler和Timer实现倒计时和三秒跳转
- handler倒计时
- Handler倒计时
- Handler倒计时
- Handler倒计时
- 倒计时跳转
- Andorid启动页倒计时用Handler实现
- Handler实现倒计时
- handler.postDelayed循环倒计时
- 倒计时 Timer和handler
- 倒计时跳转页面
- JavaScript 倒计时跳转
- 倒计时自动跳转
- 蓝桥杯 算法训练 猴子分苹果
- Dubbo架构设计详解
- JavaScript Function
- 空间域和变换域(以傅里叶变换为例)
- ArrayList和LinkedList、Vector的区别?
- handler倒计时跳转页
- 剑指offer---替换空格(4)
- MR--Text
- 设计模式之外观模式(Facade)
- 数据结构实验之图论五:从起始点到目标点的最短步数(BFS)
- (一)Android官方MVVM框架实现组件化之整体结构
- 一个最简单的爬虫-url管理器
- 比CycleGAN更强的非监督GAN----DistanceGAN
- PL/sql Developer 卡死后 sql文件里的语句没了,如何找回原来的内容?