android 页面停几秒后跳转
16lz
2021-01-23
//实现等待几秒后跳转,方法一new Handler().postDelayed(new Runnable() {@Overridepublic void run() {Intent intent = new Intent(MainActivity.this,ExampleActivity.class);startActivity(intent);}}, SPLASH_DISPLAY_LENGHT); //实现等待几秒后跳转,方法二 final Intent localIntent = new Intent(this, ExampleActivity.class); Timer timer = new Timer(); TimerTask tast = new TimerTask() { @Override public void run() { startActivity(localIntent); } }; timer.schedule(tast, SPLASH_DISPLAY_LENGHT);
更多相关文章
- 一个hello程序的android内核模块编译方法及在模拟器中进行测试结
- Android实现计时与倒计时(限时抢购)的几种方法(线程)
- Android 获取网络图片方法
- android 游戏 Canvas 常用方法
- Android中为Button注册监听器最常用的两种方法
- Android 保留两位小数点的4种方法