//实现等待几秒后跳转,方法一
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 页面停几秒后跳转
最新推荐文章于 2024-04-22 16:15:52 发布