title: How to Support Multiple Themes on Android?
body: <p>I have already implemented the dark and light theme:</p>
  <p><strong>theme.xml</strong></p>
  <pre><code>&lt;style name=&quot;Theme.MyApp&quot; parent=&quot;Theme.MaterialComponents.DayNight.NoActionBar&quot;&gt;
    &lt;item name=&quot;colorPrimary&quot;&gt;@color/my_app_primary&lt;/item&gt;
    &lt;!-- ... --&gt;
  &lt;/style&gt;
  </code></pre>
  <p>And then I override the color file for each theme:</p>
  <p><strong>values/colors.xml</strong></p>
  <pre><code>&lt;resources&gt;
      &lt;color name=&quot;my_app_primary&quot;&gt;@color/red&lt;/color&gt;
      &lt;color name=&quot;red&quot;&gt;#ff0000&lt;/color&gt;
      &lt;color name=&quot;green&quot;&gt;#00ff00&lt;/color&gt;
      &lt;!-- .... --&gt;
  &lt;/resources&gt;
  </code></pre>
  <p><strong>values-night/colors.xml</strong></p>
  <pre><code>&lt;resources&gt;
      &lt;color name=&quot;my_app_primary&quot;&gt;@color/green&lt;/color&gt;
      &lt;!-- .... --&gt;
  &lt;/resources&gt;
  </code></pre>
  <p>I use this code to choose the theme:</p>
  <pre><code>int theme = mPreferences.getTheme();
  if (theme == ConstUtil.DARK) {
      AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
  } else if (theme == ConstUtil.LIGHT){
      AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
  } else {
      AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
  }
  </code></pre>
  <p><strong>Question:</strong>
  How can I add another theme (third theme) ?</p>