White background when Android app start up

in styles.xml, in the theme specified in your AndroidManifest.xml, add the following line:

<item name="android:windowBackground">@android:color/black</item>

If you want to change the white screen that appears before splash screen to black just change the theme for the SplashActivity rather than for the entire app.

You can use this:

<activity
    android:name="your.package.SplashActivity"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen" >
       <intent-filter>
           <action android:name="android.intent.action.MAIN" />
           <category android:name="android.intent.category.LAUNCHER" />
       </intent-filter>
</activity>

Hope this helps.


in drawable folder, create your own starting_screen.xml

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape>
            <!-- black background -->
            <solid android:color="@color/colorBlack" />
        </shape>
    </item>
    <!-- launcher icon -->
    <item android:drawable="@mipmap/ic_launcher_foreground" android:height="150dp" android:width="150dp" android:gravity="center" />
</layer-list>

then add this to your style

<item name="android:windowBackground">@drawable/starting_screen</item>

now a black screen with your launcher icon will appear whenever you launch your application


Use this tag in your manifest:

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

instead of :

this.requestWindowFeature(Window.FEATURE_NO_TITLE);