This is how my style.xml
looks like:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#2196F3</item>
<item name="colorPrimaryDark">#1976D2</item>
<item name="colorAccent">#FF4081</item>
...........
</style>
I want to override the "colorPrimary"
and "colorAccent"
programmatically (using java
) from Appliation class or Activity class. Can anyone help me how I can make it possible?
Note: I don't want to create multiple style.xml
files for different themes. I just want to override the basic colors programmatically e.g. I want to "colorPrimary"
to #FF0000
from #2196F3
.