title: setDefaultNightMode not working when using setTheme in main activity
body: <p>I have an app where I'm forcing &quot;MODE_NIGHT_NO&quot; in my main (and only) activity, I do this right after super.onCreate().</p>
  <pre><code>AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO)
  </code></pre>
  <p>Now I'm adding a splash screen following <a href="https://medium.com/android-news/launch-screen-in-android-the-right-way-aca7e8c31f52" rel="nofollow noreferrer">this guide</a>, basically:</p>
  <ul>
  <li><p>Create a drawable for the splash screen</p>
  </li>
  <li><p>Create a style in <strong>values\themes.xml</strong> called SplashScreen with parent AppTheme (AppTheme's parent is <strong>Theme.MaterialComponents.DayNight.NoActionBar</strong>)</p>
  <pre><code>&lt;style name=&quot;SplashTheme&quot; parent=&quot;AppTheme&quot;&gt;
      &lt;item name=&quot;android:windowBackground&quot;&gt;@drawable/splash_screen&lt;/item&gt;
  &lt;/style&gt;
  
  </code></pre>
  </li>
  <li><p>Assign SplashTheme to the main activity in the Manifest</p>
  <pre><code>        android:name=&quot;.MainDrawerActivity&quot;
          android:theme=&quot;@style/SplashTheme&quot;...
  </code></pre>
  </li>
  <li><p>Lastly call setTheme in the main activity, before super.onCreate() to set the correct AppTheme for the whole app</p>
  <pre><code>override fun onCreate(savedInstanceState: Bundle?) {
      setTheme(R.style.AppTheme)
      super.onCreate(savedInstanceState)
      AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO)
      setContentView(R.layout.activity_main_drawer)
  
  </code></pre>
  </li>
  </ul>
  <p>The splash screen works, but the issues is that after the splash screen finishes, the theme is changed to dark mode. Even if the phone IS NOT in dark mode.</p>
  <p>I've tried calling it like this, but it doesn't work either, same behavior:</p>
  <pre><code>override fun onCreate(savedInstanceState: Bundle?) {
      AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO)
      setTheme(R.style.AppTheme)
      super.onCreate(savedInstanceState)
      setContentView(R.layout.activity_main_drawer)
  </code></pre>
  <p>I even tried deleting <strong>values-night\themes.xml</strong> to see what would happen, but same result. (I've restored said folder)</p>
  <p>Why is it that setDefaultNightMode(MODE_NIGHT_NO) is not working in the same way when adding setTheme(AppTheme)?</p>
  <p>Any guidance is highly appreciated.</p>