Difference between onSingleTapConfirmed and onSingleTapUp

Binoy Babu picture Binoy Babu · Mar 2, 2015 · Viewed 6.9k times · Source

What is the difference between onSingleTapConfirmed and onSingleTapUp in GestureDetector.SimpleOnGestureListener? Which one of these is similar to onClick methods?

Answer

Fahim picture Fahim · Mar 2, 2015

According to the GestureDetector.SimpleOnGestureListener documentation,

onSingleTapConfirmed

Notified when a single-tap occurs.

Unlike onSingleTapUp(MotionEvent), this will only be called after the detector is confident that the user's first tap is not followed by a second tap leading to a double-tap gesture.

onSingleTapUp

Notified when a tap occurs with the up MotionEvent that triggered it.

I think the onClick method is similar to onSingleTapConfirmed.