2012-02-26 137 views
-1

我有一個基本的XML Android應用程序。在應用程序啓動後的前幾秒,我如何獲得圖像apear,然後打開main.xml頁面?如何在Android應用上顯示啓動畫面圖像?

+4

對於SO,已經有[類似的問題很多](http://stackoverflow.com/search?q=splash+screen+android&submit=search)。你試過什麼了? – 2012-02-26 01:36:21

回答

1
TimerTask timerTask; 
Timer timer; 

timerTask = new TimerTask() { 

     @Override 
     public void run() { 
      startActivity(new Intent("com.package.SECONDACTIVITY")); 
      // change the Intent above to whatever your second activity is. 
      finish(); 
     } 
    }; 

timer = new Timer(); 
timer.schedule(timerTask, 1 * 1000); 
// change the 1 above to however many seconds you wanna display the splash 
相關問題