Black screen before Splash screen appear in android Black screen before Splash screen appear in android android android

Black screen before Splash screen appear in android


Add a theme with the background you are using to your application tag in the manifest file to prevent the black screen to be drawn.

theme.xml

<resources><!-- Base application theme is the default theme. --><style name="Theme" parent="android:style/Theme" /><style name="Theme.MyAppTheme" parent="Theme">    <item name="android:windowNoTitle">true</item>    <item name="android:windowContentOverlay">@null</item>    <item name="android:windowBackground">@drawable/my_app_background</item></style></resources>

AndroidManifest.xml

....<application        android:name="@string/app_name"        android:icon="@drawable/ic_launcher"        android:label="@string/app_name"        android:theme="@style/Theme.MyAppTheme"         >....

Read why there is a black screen here On app launch, Android displays a simple preview window (based on your activity theme) as an immediate response to the user action. Then the preview window crossfades with your actual UI, once that has fully loaded. To ensure a smooth visual transition, your activity theme should match your full UI as closely as possible. The below image shows how the experience can be jarring if not handled properly.


This initial screen that you see is called the "Preview" screen. You can disable this completely by declaring this in your theme:

android:windowDisablePreview<style name="Theme.MyTheme" parent="android:style/Theme.Holo">    <!-- This disables the black preview screen -->    <item name="android:windowDisablePreview">true</item></style>

An explanation of how to handle this screen is posted here: http://cyrilmottier.com/2013/01/23/android-app-launching-made-gorgeous/


Add this line in your AndroidManifest.xml to the Launcher Activity:

android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen