Custom view with button like behavior on click/touch
<p>I have created a custom View which I usually attach an onClickListener to. I'd like to have some button like behavior: if it is pressed, it should alter its appearance which is defined in the onDraw() method. However, this code does not work:</p>

<pre><code>//In my custom View:

@Override
protected void onDraw(Canvas canvas)
{

    boolean pressed = isPressed();
    //draw depending on the value of pressed
}

//when creating the view:
MyView.setClickable(true);
</code></pre>

<p>pressed always has the value false. What's wrong?</p>

<p>Thanks a lot!</p>
