**Hi guys am doing an android project to implement the swipe functionality.
How to do that.**

Am trying with onfling method but it doesnt work for me.. Anyone have the correct solution pls reply to this post.

My onfling code is

```
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
    if (mGesturesEnabled) {
        try {
            if (e2.getY() - e1.getY() > StudyOptions.sSwipeMinDistance && Math.abs(velocityY) > StudyOptions.sSwipeThresholdVelocity && Math.abs(e1.getX() - e2.getX()) < StudyOptions.sSwipeMaxOffPath && !mIsYScrolling) {
                // down
                executeCommand(mGestureSwipeDown);
            } else if (e1.getY() - e2.getY() > StudyOptions.sSwipeMinDistance && Math.abs(velocityY) > StudyOptions.sSwipeThresholdVelocity && Math.abs(e1.getX() - e2.getX()) < StudyOptions.sSwipeMaxOffPath && !mIsYScrolling) {
                // up
                executeCommand(mGestureSwipeUp);
            } else if (e2.getX() - e1.getX() > StudyOptions.sSwipeMinDistance && Math.abs(velocityX) > StudyOptions.sSwipeThresholdVelocity && Math.abs(e1.getY() - e2.getY()) < StudyOptions.sSwipeMaxOffPath && !mIsXScrolling && !mIsSelecting) {
                // right
                executeCommand(mGestureSwipeRight);
            } else if (e1.getX() - e2.getX() > StudyOptions.sSwipeMinDistance && Math.abs(velocityX) > StudyOptions.sSwipeThresholdVelocity && Math.abs(e1.getY() - e2.getY()) < StudyOptions.sSwipeMaxOffPath && !mIsXScrolling && !mIsSelecting) {
                // left
                executeCommand(mGestureSwipeLeft);
            }

            mIsXScrolling = false;
            mIsYScrolling = false;
         } catch (Exception e) {
            Log.e(AnkiDroidApp.TAG, "onFling Exception = " + e.getMessage());
         }
    }
    return false;
}

```