Android: how to use the current theme's colors in a drawable xml?
<p>I have defined two themes with different primary, primary dark, primary light and accent colors.</p>

<pre><code>&lt;style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"&gt;
    &lt;item name="colorPrimary"&gt;@color/primary&lt;/item&gt;
    &lt;item name="colorPrimaryDark"&gt;@color/primary_dark&lt;/item&gt;
    &lt;item name="colorAccent"&gt;@color/accent&lt;/item&gt;
&lt;/style&gt;

&lt;style name="AppTheme2" parent="AppTheme"&gt;
    &lt;item name="colorPrimary"&gt;@color/primary_2&lt;/item&gt;
    &lt;item name="colorPrimaryDark"&gt;@color/primary_dark_2&lt;/item&gt;
    &lt;item name="colorAccent"&gt;@color/accent_2&lt;/item&gt;
&lt;/style&gt;
</code></pre>

<p>AppTheme is default for <code>&lt;application/&gt;</code>
Then I set AppTheme2 in specific activities.</p>

<p>In a drawable file xml I'm using the same primary colors of AppTheme defined in colors.xml</p>

<p>The drawable is used in many activities from both themes, so when there is AppTheme2 I see the different colors.
Is there a way to make the drawable use the colors of the current theme for the current activity?</p>