title: Android change hover color of card view which is clickable
body: <p>I am trying to change color of my card view when someone click on it. So far I have tried using this code below:</p>
  
  <pre><code> //drawable/selector.xml
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
     &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
     &lt;item android:state_pressed="true"android:drawable="@color/button_pressed"/&gt; &lt;!-- pressed --&gt;
     &lt;item android:state_focused="true" android:drawable="@color/button_focused"/&gt; &lt;!-- focused --&gt; 
    &lt;item android:drawable="@color/button_default"/&gt; &lt;!-- default --&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>This is my selector code this works perfect when I use this in button code is below:</p>
  
  <pre><code>&lt;Button
    android:id="@+id/button1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/selector"
    android:text="Click Me"
   /&gt;
  </code></pre>
  
  <p>I am trying to do this inside card view I can't see anything inside my card view I am using selector like this:</p>
  
  <pre><code>  &lt;android.support.v7.widget.CardView
      android:foreground="?android:attr/selectableItemBackground"
      android:clickable="true"
      android:layout_width="170dp"
      android:layout_height="150dp"
      android:layout_margin="4dp"
      android:onClick="economy"
      android:background="@drawable/selector"
      &gt;
     &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p>My card is clickable my question is can I do this inside card view </p>