Multiple Styles.xml files in Android Application



I was wondering if you could have multiple styles.xml files in your android application, so that when you want to switch to a custom theme you can just change to a different styles.xml file. The reason I want multiple files is because I want to change the style of individual widgets and be able to change the theme dynamically at runtime.


Basically I need something like this:



//User clicks a different theme from an options menu
switch (item.getItemId())
{
case R.id.Theme1:
changeStyleFile(styles1.xml);
break;
case R.id.Theme2:
changeStyleFile(styles2.xml);
break;
}

No comments:

Post a Comment