decades
decades

Reputation: 827

Android: Two finger double tap possible to detect with GestureDetector?

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);
    } 

}

Upvotes: 6

Views: 3535

Answers (1)

Cyril Mottier
Cyril Mottier

Reputation: 1624

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).

Upvotes: 3

Related Questions