You should return true;
in case MotionEvent.ACTION_DOWN:
, so the MotionEvent.ACTION_UP
will be handled.
As explained on View.OnTouchListener:
Returns:
True if the listener has consumed the event, false otherwise.
MotionEvent.ACTION_UP
Won’t get called until the MotionEvent.ACTION_DOWN
occurred, a logical explanation for this is that it’s impossible for an ACTION_UP
to occur if an ACTION_DOWN
never occurred before it.
This logic enables the developer to block further events after ACTION_DOWN
.