I have a custom listview
with a setOnTouchListener
view.setOnTouchListener(new OnTouchListener() {
@Override
publi
In your case you need either ACTION_UP or ACTION_DOWN event not ACTION_MOVE so to avoid ACTION_MOVE you can do something like this:
if(event.getAction() == MotionEvent.ACTION_DOWN)
{
isDown = false;
}
if(event.getAction() == MotionEvent.ACTION_UP && !isDown)
{
// action you want to perform
}
if(event.getAction() == MotionEvent.ACTION_MOVE)
{
isDown = true;
}
as far as changing color is concerned, you can store previous view in a global variable and while going for next touch, you can change that global view color to normal.