Button setPressed() onClick
<p>this is an easy question,</p>

<p>in my xml file i have :</p>

<pre><code>&lt;Button
android:id="@+id/button_8"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/Bf"
android:background="@drawable/button_purple" 
android:layout_weight="1"
android:textColor="#ffffff"
android:onClick="action"            
/&gt;
</code></pre>

<p>And in my activity i have that :</p>

<pre><code>public void action (View v)
{
    s = "m";
    changeCouleur("blue");
    v.setPressed(true);
}
</code></pre>

<p>When i pressed the button it's working but the button don't stay pressed.</p>

<p>I don't use an image this is what i use for the color :</p>

<pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;item android:state_pressed="true" &gt;
        &lt;shape&gt;
            &lt;solid
                android:color="#449def" /&gt;
            &lt;stroke
                android:width="1dp"
                android:color="#2f6699" /&gt;
            &lt;corners
                android:radius="3dp" /&gt;
            &lt;padding
                android:left="10dp"
                android:top="10dp"
                android:right="10dp"
                android:bottom="10dp" /&gt;
        &lt;/shape&gt;
    &lt;/item&gt;
    &lt;item android:state_focused="true" &gt;
        &lt;shape&gt;
            &lt;solid
                android:color="#449def" /&gt;
            &lt;stroke
                android:width="1dp"
                android:color="#2f6699" /&gt;
            &lt;corners
                android:radius="3dp" /&gt;
            &lt;padding
                android:left="10dp"
                android:top="10dp"
                android:right="10dp"
                android:bottom="10dp" /&gt;
        &lt;/shape&gt;
    &lt;/item&gt;
    &lt;item&gt;
        &lt;shape&gt;
            &lt;gradient
                android:startColor="#449def"
                android:endColor="#2f6699"
                android:angle="270" /&gt;
            &lt;stroke
                android:width="1dp"
                android:color="#2f6699" /&gt;
            &lt;corners
                android:radius="4dp" /&gt;
            &lt;padding
                android:left="10dp"
                android:top="10dp"
                android:right="10dp"
                android:bottom="10dp" /&gt;
        &lt;/shape&gt;
    &lt;/item&gt;
&lt;/selector&gt;
</code></pre>

<p>Thanks in advance if you noticed something wrong.
Please anyone have any idea ?</p>
