我有一个基本的XML Android应用程序。如何在应用程序启动后的前几秒显示图像,然后打开main.xml页面?
答案 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