question above. For me getPointerCount() is always 1, once a double tap is detected.
private GestureDetector mGestureDetector;
mGestureDetector = new GestureDetector(this, new MyGestureListener());
...
public boolean onTouch(View v, MotionEvent event) {
return mGestureDetector.onTouchEvent(event);
}
...
private class MyGestureListener extends GestureDetector.SimpleOnGestureListener {
@Override
public boolean onDoubleTap(MotionEvent e) {
return super.onDoubleTap(e);
}
}
Android provides special types of touch screen events such as pinch , double tap, scrolls , long presses and flinch. These are all known as gestures. Android provides GestureDetector class to receive motion events and tell us that these events correspond to gestures or not.
 Gestures are scripted “solutions” that take advantage of these touch events.  So instead of tracking two touch points to determine if they're moving away or closer to one another in order to manipulate the size of a photo, you can just use GESTURE_ZOOM.
The GestureDetector
is only capable of detecting "one finger" gestures. The "double tap" gesture you are currently listening to, occurs when the user tapped, released and tapped again the screen with one of his/her fingers.
If you want to listen to gestures with multiple fingers you'll have to do it on your own or use the ScaleGestureDetector
(only for the scale gesture).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With