I have an activity intercepting touch events via the onTouchEvent method and I am using the gesture detector class to detect common movements. I have followed the Android Developer API but my SimpleGestureListener.onDoubleTap method never gets called despite double clicking.

In my activity definition I have:

protected final GestureDetector.SimpleOnGestureListener handler = new GestureDetector.SimpleOnGestureListener() { final String DEBUG_STR = "Gestures"; @Override public boolean onDown(MotionEvent event) { Log.i(DEBUG_STR, "onDown"); childView.setText("onDown"); return true; } @Override public boolean onDoubleTap(MotionEvent event) { Log.i(DEBUG_STR, "onDoubleTap"); childView.setText("onDoubleTap"); return true; } public boolean onDoubleTapEvent(MotionEvent e) { Log.i(DEBUG_STR, "onDoubleTap"); childView.setText("onDoubleTap"); return true; } @Override public boolean onFling(MotionEvent begin, MotionEvent end, float velocityX, float velocityY) { Log.i(DEBUG_STR, "onFling"); childView.setText("onFling"); return true; } @Override public boolean onSingleTapConfirmed(MotionEvent event) { Log.i(DEBUG_STR, "onSingleTapConfirmed"); childView.setText("onSingleTapConfirmed"); return true; } }; protected GestureDetector detector;

In my onCreate Method I initialize the gesture detector:

detector = new GestureDetector(this, handler);

And finally my onTouchEvent method:

public boolean onTouchEvent(MotionEvent event) { detector.onTouchEvent(event); return super.onTouchEvent(event); }

When I run this activity in the simulator I get everything but the double tap registering. I've tried double clicking my mouse in the activity screen on a Nexus 5 emulated device but the double tap never seems to be printed in the log or on the screen.

I'm not sure whats going wrong here. I can't see anything obviously wrong with my code as it compiles and registers fling and single tap movements. Just no double taps.