title: Android button hover event
body: <p>I use a XML file to display a button with 2 states (normal, pressed). How can I find out when the button is pressed? Is there an event like onClick --> onPressed or how can I find it out?</p>
  
  <p>Here is the XML file I use:</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_focused="true" android:state_pressed="false" android:drawable="@drawable/buttonbluepressed" /&gt;
      &lt;item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/buttonbluepressed" /&gt;
      &lt;item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/buttonbluepressed" /&gt;
      &lt;item android:drawable="@drawable/buttonblue"/&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>And here is how I use it:</p>
  
  <pre><code>&lt;Button
      android:id="@+id/button_choose"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_weight="1"
      android:background="@drawable/choose_button"
      android:onClick="onButtonClicked"
      android:text="@string/button_choose" /&gt;
  </code></pre>