title: Cannot change focus/state for button png using selector element
body: <pre><code>Android Studio 0.3.7
  </code></pre>
  
  <p>Hello,</p>
  
  <p>I have created 2 buttons png and patched using draw9patch.
  The buttons will indicate whether the buttons is pressed or unpressed.</p>
  
  <p>I have the following <code>buttons_colours.xml</code> in my values directory</p>
  
  
  
  <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;item android:state_focused="false"
          android:state_pressed="true"
          android:drawable="@drawable/rd_btn_press"/&gt; &lt;!-- pressed --&gt;
  
      &lt;item android:state_focused="true"
         android:state_pressed="false"
         android:drawable="@drawable/rd_btn"/&gt;        &lt;!-- unpressed --&gt;
  
      &lt;!-- Default --&gt;
      &lt;item android:drawable="@drawable/rd_btn"/&gt;
  
  &lt;/selector&gt;
  </code></pre>
  
  <p>In my layout for the button I have this:</p>
  
  <pre><code> &lt;Button
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Start"
          android:id="@+id/button"
          android:layout_gravity="center_horizontal"
          android:background="@drawable/rd_btn"/&gt;
  </code></pre>
  
  <p>Problem 1: I get an <code>element selector must be declared</code> in my buttons_colours.xml</p>
  
  <p>Problem 2: Not sure if this is related to problem 1, but the button never changes to my rd_btn_press state when I press it.</p>
  
  <p>Many thanks for any suggestions,</p>