Reputation: 21
When my android app run, there is a button or something which let customers to select a color to show on primarycolordack, colorprimary and so on. in others words, i want to change app theme. how to do that?
Upvotes: 1
Views: 91
Reputation: 6392
Lucky for you android mead it simple, there is a method for that inside the activity class:
setTheme(android.R.style.MyTheme);
You'll have to call this method inside on create before the super command like this:
public void onCreate(Bundle savedInstanceState) {
setTheme(android.R.style.MyTheme);
super.onCreate(savedInstanceState)
}
Upvotes: 1