I'd like to dynamically change attributes in this theme: Theme.AppCompat.Light.DarkActionBar
. In particular, I'd like to change the colorPrimary, colorAccent, and colorPrimaryDark attributes based on the data being displayed so that particular widgets like EditText
s can be themed appropriately. I know that I'd have to change the theme before setContentView(...)
of my Activity but how do I change particular attributes in the theme before I do that?
Edit: From @reVerse's comment linking to this post I know that it's impossible to change a Theme as they are immutable. Is it possible to create a Theme programmatically?