title: Custom view (button) background selector doesn't work
body: <p>I have simple custom button:</p>
  
  <pre><code>public class myButton extends Button {
      public myButton (Context context, AttributeSet attrs, int defStyle) {
          super(context, attrs, defStyle);
          commonConstructorCode();
      }
  
  
      public myButton (Context context, AttributeSet attrs) {
          super(context, attrs);
          commonConstructorCode();
      }
  
    public myButton (Context context) {
      super(context);
      commonConstructorCode();
    }
  
        private void commonConstructorCode() {
                  this.setOnTouchListener(new OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
                  int action = event.getAction(); 
  
                      if(action == MotionEvent.ACTION_DOWN) 
                      {
                        //Just to be sure that we removed all callbacks, 
                        // which should have occurred in the ACTION_UP
                        removeCallbacks(repeatClickWhileButtonHeldRunnable);
  
                        //Perform the default click action.
                        performClick();
                        //if(v.isEnabled()){
                        //Schedule the start of repetitions after a one half second delay.
                        postDelayed(repeatClickWhileButtonHeldRunnable, initialRepeatDelay);
                        //} else {
                          //  removeCallbacks(repeatClickWhileButtonHeldRunnable);
                        //}
                      }
                      else if(action == MotionEvent.ACTION_UP) {
                        //Cancel any repetition in progress.
                        removeCallbacks(repeatClickWhileButtonHeldRunnable);
                      }
                  //Returning true here prevents performClick() from getting called 
                  // in the usual manner, which would be redundant, given that we are 
                  // already calling it above.
                  return true;
        }
      });
        }
  }
  </code></pre>
  
  <p>with selector</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"
             android:drawable="@drawable/button_pressed" /&gt; &lt;!-- pressed --&gt;
       &lt;item android:state_focused="true"
             android:drawable="@android:color/white" /&gt; &lt;!-- focused --&gt;
       &lt;item android:drawable="@drawable/button_standard" /&gt; &lt;!-- default --&gt;
   &lt;/selector&gt;
  </code></pre>
  
  <p>set by</p>
  
  <pre><code>&lt;com.blabla.myButton
      ...
      background="@drawable/button_selector" /&gt;
  </code></pre>
  
  <p>Background in "normal" state is fine. But other states don't work at all. What is strange - when I change </p>
  
  <pre><code>&lt;com.blabla.myButton
  </code></pre>
  
  <p>to</p>
  
  <pre><code>&lt;Button
  </code></pre>
  
  <p>selector works perfectly fine.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>Edit:</strong>
  I added commonConstructorCode().</p>