I'm not sure what you mean by "remove gestureDetector".
Instead, you should first transfer the MotionEvent to the GestureDetector and handle the event yourself, only if the GestureDetector does not:
public boolean onTouchEvent(MotionEvent event) {
if (mGestureDetector.onTouchEvent(event)) {
return true;
}
<your code to process the event here>
}
source
share