Having this attrs.xml file:
<resources>
<attr name="customColorPrimary" format="color" value="#111111"/>
</resources>
It is possible to write with java code a new value for that color?
Can't find how to do it in the official documentation...
Short answer: No.
Long answer: All
resources
you use in your code are compiled as contents ofR
class. Every singleresource
(includingstring
,dimen
,layout
,style
,attr
and other) is compiled as some variation ofpublic static
final
int
values. That's why you can't modify it during runtime.