Frage

I created a Splash screen and it works fine. The only problem is that before the Activitywith the background image is displayed, for a second, a screen appears with the default theme of Android and the background of the app. What can I do to stop this screen appearing on startup?

thanks

StartActivity

protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.inicio);

    tareaAsincInicio = new tareaAsincronaInicio();
    tareaAsincInicio.execute();
}

Styles

<style name="AppTheme2" parent="android:Theme.Holo">
    <item name="android:windowBackground">@drawable/app_background</item>
</style>
War es hilfreich?

Lösung

give this custom_title_splash_theme to your Splash Activity in manifest

<style name="custom_title_splash_theme" parent="android:Theme">
        <item name="android:windowDisablePreview">true</item>

    </style>

or simply add this in your style

<item name="android:windowDisablePreview">true</item>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top