I'm developing an application that starts with a listview.
I'm in trouble with the setting of the themes for the application.
Material design can be applied to Android 5.0 and above. So I created a values-21 folder and create
<!-- Inherit from the light Material Theme -->
<style name="MyCustomTheme" parent="android:Theme.Material.Light">
You can configure your app to use the material theme on devices that support it and revert to an older theme on devices running earlier versions of Android:
- Define a theme that inherits from an older theme (like Holo) in res/values/styles.xml.
- Define a theme with the same name that inherits from the material theme in res/values-v21/styles.xml.
- Set this theme as your app's theme in the manifest file.
If the layouts that you design according to the material design guidelines do not use any of the new XML attributes introduced in Android 5.0 (API level 21), they will work on previous versions of Android. Otherwise, you can provide alternative layouts. You can also provide alternative layouts to customize how your app looks on earlier versions of Android.
Create your layout files for Android 5.0 (API level 21) inside
res/layout-v21/ and your alternative layout files for earlier versions of Android inside
res/layout/. For example,
res/layout/my_activity.xml is an alternative layout for res/layout-v21/my_activity.xml.