title: Android: How to use selector for background of a TextView?
body: <p>I would like my TextView to paint with a different color background when pressed. The below xml contains a Button and TextView, both of which specify a Selector as their background.  The Button works as expected, but the TextView does not change color when pressed.  Is there a way to make this work for the TextView?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
      &lt;TextView 
          android:text="temporary text view"
          android:layout_width="wrap_content"
          android:layout_height="100dip"
          android:background="@drawable/blackselector"
          /&gt;    
      &lt;Button
          android:text="temporary button"
          android:layout_width="wrap_content"
          android:layout_height="100dip"
          android:background="@drawable/blackselector"
          /&gt;   
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>selector.xml</p>
  
  <pre><code>&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"&gt;
          &lt;color android:color="#FF0000" /&gt;
      &lt;/item&gt;
      &lt;item&gt;
          &lt;color android:color="#00FF00" /&gt;
      &lt;/item&gt;
  &lt;/selector&gt;
  </code></pre>