2012-02-26 132 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 
相关问题