Trouble with giving selection effect to layout
<p>I am working on a small android application. I have some dynamically added Relative layout. I have given background image in Action down (onTouchListener) and removed that image on Action up. But I have one problem. when I drag on that layout, the first image wont disappear. that is action up is not working. So what can I do for this problem. I want to give the selection effect as in list view.</p>

<pre><code>public boolean onTouch(View v, MotionEvent event)
{

    if (event.getAction() == MotionEvent.ACTION_DOWN) {
        mCell.setBackgroundResource(R.drawable.gn_sudo_grille_selection);
        Log.d("inside cell", "Touched");
    } else if (event.getAction() == MotionEvent.ACTION_UP) {
        mCell.setBackgroundResource(R.drawable.grile);
        Log.d("inside cell", "Action-up");
    }
    return false;
}
</code></pre>
