Android: how to draw different background for Button when selected?
<p>I would like my Button to draw with a transparent background by default, to draw with a dark blue background when pressed, and to draw with a light blue background when selected.  I set the Button's background to the below selector, and am calling <code>Button.setSelected(!Button.isSelected())</code> when the button is clicked.  The pressed state works properly, but the Button draws with a transparent background when selected.  </p>

<pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/tranpsshape" /&gt; 
  &lt;item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/tranpsshape" /&gt; 
  &lt;item android:state_pressed="true" android:drawable="@drawable/pressedbuttonshape" /&gt; 
  &lt;item android:state_focused="true" android:state_enabled="true" android:drawable="@drawable/selectedshape" /&gt; 
  &lt;item android:state_enabled="true" android:drawable="@drawable/tranpsshape" /&gt; 
  &lt;item android:state_focused="true" android:drawable="@drawable/tranpsshape" /&gt; 
  &lt;item android:state_selected="true" android:drawable="@drawable/selectedshape" /&gt; 
  &lt;item android:drawable="@drawable/tranpsshape" /&gt; 
&lt;/selector&gt;
</code></pre>

<p>selectedshape.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;shape xmlns:android="http://schemas.android.com/apk/res/android" &gt;
    &lt;solid android:color="#A3DAF2"/&gt;
&lt;/shape&gt;
</code></pre>

<p>pressedbuttonshape.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;shape xmlns:android="http://schemas.android.com/apk/res/android" &gt;
    &lt;solid android:color="#4ABDE8/&gt;
&lt;/shape&gt;
</code></pre>

<p>tranpsshape.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;shape xmlns:android="http://schemas.android.com/apk/res/android" &gt;
    &lt;solid android:color="#00000000"/&gt;

&lt;/shape&gt;
</code></pre>
