title: CardView custom style attributes
body: <p>I read many other question about this stuff like <a href="https://stackoverflow.com/questions/27341832/how-to-put-a-cardview-attribute-in-a-style">this</a> or <a href="https://stackoverflow.com/questions/31221911/how-to-set-cardview-attributes-in-style-xml-file-in-android">this</a> or <a href="https://stackoverflow.com/questions/30417847/attach-custom-cardview-style-to-theme">this</a> but no one work for me.</p>
  
  <p>I need to create a custom style form CardView. This is my code:</p>
  
  <p>style.xml</p>
  
  <pre><code>&lt;resources &gt;    
   ...
      &lt;style name="CardViewStyle" parent="CardView"&gt;
          &lt;item name="app:cardBackgroundColor"&gt;#d9edf7&lt;/item&gt;
      &lt;/style&gt;    
  &lt;/resources&gt;
  </code></pre>
  
  <p>my_card.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:theme="@style/CardViewStyle"&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:orientation="vertical"&gt;
  
          &lt;TextView
              android:id="@+id/txvId"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content" /&gt;
  
          &lt;TextView
              android:id="@+id/txvDatetime"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content" /&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p>In my app gradle file</p>
  
  <pre><code>compileSdkVersion 26
  minSdkVersion 19
  targetSdkVersion 26
  implementation 'com.android.support:appcompat-v7:26.1.0'
  compile 'com.android.support:recyclerview-v7:26.1.0'
  compile 'com.android.support:cardview-v7:26.1.0'
  </code></pre>
  
  <p>Unlikely this do not work for me. Nothing happens, but I do not find the problem.
  If I do not use the custom style and do directly :</p>
  
  <p>my_card.xml</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      app:cardBackgroundColor="#d9edf7" &gt;
  
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="match_parent"
              android:orientation="vertical"&gt;
  
              &lt;TextView
                  android:id="@+id/txvId"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content" /&gt;
  
              &lt;TextView
                  android:id="@+id/txvDatetime"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content" /&gt;
  
          &lt;/LinearLayout&gt;
      &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p>It works fine. But I need to use a custom style.</p>