android 页面停几秒后跳转

		//实现等待几秒后跳转,方法一
		new Handler().postDelayed(new Runnable() {
			@Override
			public 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);

你可能感兴趣的:(Android)