如何在Android应用上拥有闪屏图像?

时间:2012-02-26 01:33:37

标签: java android xml image

我有一个基本的XML Android应用程序。如何在应用程序启动后的前几秒显示图像,然后打开main.xml页面?

1 个答案:

答案 0 :(得分: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