Android - SimpleOnGestureListener not receiving event

If you are creating SimpleOnGestureListener to capture double tab, single tab, etc... event and your extended class is not responding or capturing any event, the below information may help

Overriding onDown method

Make sure you override onDown(MotionEvent e) and return true

@Override
public boolean onDown(MotionEvent e) {
return true;
}

By default, SimpleOnGestureListener onDown method return false. However, every touch event start at onDown. If this onDown method return false, the event will not propagate to other event method such as onDoubleTab and onSingleTabConfirmed. Therefore, those event method will not be trigger.

Comments

  1. That saved my time, was googleing for an hour why the doubleTab wasn't working for me.

    ReplyDelete

Post a Comment

Popular Posts