handler.postDelayed()方法

来源:互联网 发布:c语言中复合语句的特点 编辑:程序博客网 时间:2024/05/20 00:12

//handler.postDelayed()方法用于intent延迟跳转,定时刷新UI,一般只用于启动页跳转,其他UI页面慎用。

   new Handler().postDelayed(new Runnable() {        @Override        public void run() {            //跳转到主界面            Intent  intent = new Intent(SplashActivity.this,MainActivity.class);            startActivity(intent);            finish();        }    },1000*2);
0 0
原创粉丝点击