Gesture detection on Fragment
Here is the workaround which i made for this problem.
I had to override dispatchTouchEvent()
method in my Activity
. This gets called when a touch event occurs to the window.
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
boolean handled = swipeDetector.onTouchEvent(ev);
if (!handled) {
return super.dispatchTouchEvent(ev);
}
return handled;
}