How to use android:Theme.Material (Material theme) in styles.xml android?

enter image description here

Your app theme is defined in the manifest file:

<application
    android:theme="@style/AppTheme">

You will find this style defined in /res/values/styles.xml.

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

Using AppCompat allows your themes to be used even for devices older than Android 5.0. The main Material Design Themes are shown below.

Dark Theme

enter image description here

Light Theme

enter image description here

Light Theme with Dark Action Bar

enter image description here

Further Reading

  • Using the Material Theme (Android docs)

If your are using an AppCompatActivity, just use only a style in your res/values/styles.xml, and check the namespace that your are using for colorPrimary, colorPrimaryDark....

 <style name="AppTheme" parent="Theme.AppCompat.Light">
    <item name="colorPrimary">@color/primary</item>
    <item name="colorPrimaryDark">@color/primary_dark</item>
    <item name="colorAccent">@color/accent</item>
 </style>