title: Support both light and dark theme in Android Pie
body: <p>Android Pie added the ability to toggle light/dark theme in the Settings -> Display -> Device Theme menu.</p>
  
  <p>I want my app to apply the correct theme according to the Device Theme set in the device settings.</p>
  
  <p>According to the <a href="https://developer.android.com/guide/topics/ui/look-and-feel/themes" rel="nofollow noreferrer">Styles and Themes</a> Android guide, for dark mode the app should use a theme that extends <code>Theme.AppCompat</code>, and for light mode the app should use a theme that extends <code>Theme.AppCompat.Light</code>.</p>
  
  <p>So I created two themes in my app:</p>
  
  <pre><code>&lt;style name="AppTheme.Dark" parent="Theme.AppCompat"&gt;
    ...
  &lt;/style&gt;
  
  &lt;style name="AppTheme.Light" parent="Theme.AppCompat.Light"&gt;
    ...
  &lt;/style&gt;
  </code></pre>
  
  <p>However in <code>AndroidManifest.xml</code> when I declare the application with the <code>&lt;application&gt;</code> tag I can only specify one theme in the <code>android:theme</code> attribute:</p>
  
  <pre><code>&lt;application
      android:name=".MyApplication"
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:roundIcon="@mipmap/ic_launcher"
      android:supportsRtl="true"
      android:theme="@style/AppTheme.Light"
      tools:replace="android:name"&gt;
  </code></pre>
  
  <p>How do I declare my application in <code>AndroidManifest.xml</code> to <strong>dynamically</strong> pick <code>@style/AppTheme.Light</code> or <code>@style/AppTheme.Dark</code> according to the Device Theme set in the device settings?</p>