【发布时间】:2015-05-10 18:11:49
【问题描述】:
public class SplashScreen extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
try {
Thread.sleep(5000);
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
Intent LoginActivity = new Intent(SplashScreen.this, LoginActivity.class);
startActivity(LoginActivity);
finish();
}
}
activity_splash_screen 是启动画面的布局。我的应用程序显示白屏而不是我的启动图像。
当我没有设置下一个动作LoginActivity我的启动图像回来了!
public class SplashScreen extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
try {
Thread.sleep(5000);
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
// Intent LoginActivity = new Intent(SplashScreen.this, LoginActivity.class);
// startActivity(LoginActivity);
finish();
}
}
【问题讨论】:
标签: android splash-screen