How do I change the theme attribute in code?

Is it possible to dynamically change theme attributes? For example, set the android: colorPrimary attribute for the theme. I know I can apply different themes to an activity when I create it, but it requires predefined styles in the resources, which means the attributes are fixed. If I want to load a single theme from the server (it might be a config file with a specific color attribute), it doesn't work.

+3


source to share





All Articles