【Android】实现Activity页面暂停几秒后跳转的两种方法
方法一
package com.app.weixin;import java.util.Date;import java.util.Timer;import java.util.TimerTask;import com.app.wexin.R;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.os.Handler;public class WelcomeActivity extends Activity{@Overrideprotected void onCreate(Bundle savedInstanceState) {// TODO Auto-generated method stubsuper.onCreate(savedInstanceState);setContentView(R.layout.welcome); final Intent localIntent = new Intent(this, Tabs.class); Timer timer = new Timer(); TimerTask tast = new TimerTask() { @Override public void run() { startActivity(localIntent); } }; timer.schedule(tast, 1500); }}此为暂停1.5秒后跳转。