title: How to disable dark theme in Android Pie?(Pre Android 10)
body: <p>Dark Mode official support came in android 10, but we have dark mode option in Android pie and some pre android 10 MIUI as well.
  As the app doesn't support dark mode, I want it disabled.
  Using the below options, it works fine from API 29 but not before that.</p>
  <pre><code>&lt;item name=&quot;android:forceDarkAllowed&quot; tools:targetApi=&quot;p&quot;&gt;false&lt;/item&gt;
  </code></pre>
  <p>&amp;</p>
  <pre><code>AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
  </code></pre>
  <p>&amp;</p>
  <pre><code>android:forceDarkAllowed=&quot;false&quot;
  </code></pre>