Creating styles-v21.xml Creating styles-v21.xml xml xml

Creating styles-v21.xml


Right click on res folder, choose New --> Android resource file, set the same name for the new file "styles", in Available qualifiers: choose the last item "Version" and finally set "Platform API level" 21.


By default, Android Studio doesn't create styles.xml (v21). What you need to do is create a folder structure like the following:

  • res/values/styles.xml
  • res/values-v21/styles.xml

And this is what you will get in Android Studio:

enter image description here

Then you can defined different AppTheme for different API levels.


You should create styles.xml for version 21 in values-v21 folder and android studio automatically add it as styles.xml(v21)