Swipe in android
<p><strong>Hi guys am doing an android project to implement the swipe functionality.
How to do that.</strong></p>

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

<p>My onfling code is</p>

<pre><code>@Override
        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
            if (mGesturesEnabled) {
         try {
         if (e2.getY() - e1.getY() &gt; StudyOptions.sSwipeMinDistance &amp;&amp; Math.abs(velocityY) &gt; StudyOptions.sSwipeThresholdVelocity &amp;&amp; Math.abs(e1.getX() - e2.getX()) &lt; StudyOptions.sSwipeMaxOffPath &amp;&amp; !mIsYScrolling) {
                        // down
         executeCommand(mGestureSwipeDown);
        } else if (e1.getY() - e2.getY() &gt; StudyOptions.sSwipeMinDistance &amp;&amp; Math.abs(velocityY) &gt; StudyOptions.sSwipeThresholdVelocity &amp;&amp; Math.abs(e1.getX() - e2.getX()) &lt; StudyOptions.sSwipeMaxOffPath &amp;&amp; !mIsYScrolling) {
                        // up
         executeCommand(mGestureSwipeUp);
        } else if (e2.getX() - e1.getX() &gt; StudyOptions.sSwipeMinDistance &amp;&amp; Math.abs(velocityX) &gt; StudyOptions.sSwipeThresholdVelocity &amp;&amp; Math.abs(e1.getY() - e2.getY()) &lt; StudyOptions.sSwipeMaxOffPath &amp;&amp; !mIsXScrolling &amp;&amp; !mIsSelecting) {
                       // right
        executeCommand(mGestureSwipeRight);
                    } else if (e1.getX() - e2.getX() &gt; StudyOptions.sSwipeMinDistance &amp;&amp; Math.abs(velocityX) &gt; StudyOptions.sSwipeThresholdVelocity &amp;&amp; Math.abs(e1.getY() - e2.getY()) &lt; StudyOptions.sSwipeMaxOffPath &amp;&amp; !mIsXScrolling &amp;&amp; !mIsSelecting) {
                     // left
                     executeCommand(mGestureSwipeLeft);
                    }
                mIsXScrolling = false;
                mIsYScrolling = false;
                 }
                 catch (Exception e) {
                    Log.e(AnkiDroidApp.TAG, "onFling Exception = " + e.getMessage());
                 }
            }
            return false;
        }
</code></pre>

<p>Thanks in advance</p>
