【发布时间】:2016-09-30 14:36:38
【问题描述】:
我在启动应用程序时遇到问题。白色背景在第一次启动时显示几秒钟,然后在第二次启动时有时不会出现。
我在我的 AppTheme 中使用了这个
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowBackground">@drawable/my_app_background</item>
我成功了,但它在应用程序内也显示了my_app_background 图像,而不是white background
我当前的应用主题
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
</style>
启动画面
public class SplashScreen extends AppCompatActivity{
// Splash screen timer
public static int SCREEN_TIMEOUT=3000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash_screen);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(SplashScreen.this, MainActivity.class);
startActivity(intent);
finish();
Toast.makeText(SplashScreen.this,"Message",Toast.LENGTH_SHORT).show();
}
}, SCREEN_TIMEOUT);
}
}
【问题讨论】:
-
请您粘贴您的 Splash Activity 的代码吗?