2012-02-25 145 views

回答

28

这是你可以如何进行:

int timeout = 4000; // make the activity visible for 4 seconds 

Timer timer = new Timer(); 
timer.schedule(new TimerTask() { 

    @Override 
    public void run() { 
     finish(); 
     Intent homepage = new Intent(Activity1.this, Activity2.class); 
     startActivity(homepage); 
    } 
}, timeout); 
+0

非常感谢。 – 2012-02-26 08:17:47

0

你可以在你的活动添加处理程序,如:

private Handler handler = new Handler(); 

然后在你的活动onCreate()方法,您可以拨打:

handler.postDelayed(new Runnable() { 

      @Override 
      public void run() { 
       startActivity(yourIntent); 
      } 
     }, 4000); 
相关问题