Change background color in launch screen when using DayNight theme : <p>I am using <strong>DayNight</strong> theme with <strong>launch screen</strong>.</p>

<p>Launch screen is a layer-list with white background.</p>

<p>So when its day, <strong>white</strong> launch screen shows followed by <strong>white</strong> activity. But at night, <strong>white</strong> launch screen shows follwed by <strong>dark</strong> activity.</p>

<p><em>How can i change the background color in the launch screen according to the theme.</em></p>

<p>Cannot use custom color attrs because there is only a DayNight theme.</p>

<p><strong>themes.xml</strong></p>

<pre><code>&lt;resources&gt;
&lt;!-- Base application theme. --&gt;
&lt;style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar"&gt;
    &lt;item name="colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
    &lt;item name="colorPrimaryDark"&gt;@color/colorPrimaryDark&lt;/item&gt;
    &lt;item name="colorAccent"&gt;@color/colorAccent&lt;/item&gt;
    &lt;item name="android:colorControlNormal"&gt;@color/colorAccent&lt;/item&gt;
&lt;/style&gt;

&lt;style name="LaunchTheme" parent="AppTheme"&gt;
    &lt;item name="android:windowBackground"&gt;@drawable/launch_screen&lt;/item&gt;
&lt;/style&gt;
</code></pre>

<p></p>

<p><strong>launch_screen.xml</strong></p>

<pre><code>&lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;
&lt;item&gt;
    &lt;color android:color="@color/material_white"/&gt;
&lt;/item&gt;
&lt;item&gt;
    &lt;bitmap
       android:gravity="center"
       android:src="@drawable/launch_logo"
       android:tileMode="disabled"/&gt;
&lt;/item&gt;
</code></pre>

<p></p>
