android "state_pressed" works only in second attempt
<p>I've one menu button and a motion class for a longer state_pressed state (0,5 sec.). So long all works fine, but one problem occurs :</p>

<p>I've to press first time on my button, state_pressed doesn't work at this first time then on the second attempt my code works correctly and state_pressed works with 0,5 seconds duration.</p>

<p>How can I make it that it works on the first press? I think tehre is a problem with the hover.xml file and in combination with the setBackgroundDrawable?</p>

<p>Thanks all in advance for ur help!</p>

<p><strong>This is my hover.XML drawable</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
</code></pre>

<p></p>

<pre><code>&lt;item android:state_focused="false" 
      android:state_pressed="true" 
      android:drawable="@drawable/buttonstyle_pressed" /&gt;

&lt;item android:drawable="@drawable/buttonstyle" /&gt;
</code></pre>

<p></p>

<p><strong>And this is my java code</strong></p>

<pre><code>    Button menubutton_start;

    menubutton_start = (Button) FindViewById(R.id.menustart);


 menubutton_start.setOnClickListener(new View.OnClickListener() {

 public void onClick(View v) {     

  menubutton_start.setBackgroundDrawable(getResources().getDrawable(R.drawable.hover));


   final Handler handler = new Handler();            

        handler.postDelayed(new Runnable() {

              public void run() {

               Intent myIntent = new Intent(GameActivity.this, NextActivity.class);
               GameActivity.this.startActivity(myIntent);

                    }

                }, 500);  // end of Handler new Runnable()


    }  // end of OnClick()


});  // end of setOnClickListener
</code></pre>
