title: How to set onFling() event of Gesture on ScrollView in android?
body: <p>I set the <code>onFling()</code> event of Gesture on <code>ScrollView</code>, but it is not working on ScrollView, </p>
  
  <pre><code>package com.doubletap;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.GestureDetector;
  import android.view.GestureDetector.OnDoubleTapListener;
  import android.view.GestureDetector.OnGestureListener;
  import android.view.MotionEvent;
  import android.widget.TextView;
  
  public class DoubleTapActivity extends Activity implements OnGestureListener 
  {
  private GestureDetector gd;
  
  private TextView tvTap;
  
  String TAG = getClass().getSimpleName();
  
  private static final int SWIPE_MIN_DISTANCE = 120;
  private static final int SWIPE_MAX_OFF_PATH = 250;
  private static final int SWIPE_THRESHOLD_VELOCITY = 200;
  
  @Override
  public void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      tvTap = (TextView)findViewById(R.id.tvTap);
  
      gd = new GestureDetector(this);
  
      gd.setOnDoubleTapListener(new OnDoubleTapListener()
      {
          @Override
          public boolean onDoubleTap(MotionEvent e) 
          {
              return false;
          }
  
          @Override
          public boolean onDoubleTapEvent(MotionEvent e) 
          {
              return false;
          }
  
          @Override
          public boolean onSingleTapConfirmed(MotionEvent e) 
          {
              return false;
          }
      });
  }
  
  @Override
  public boolean onTouchEvent(MotionEvent event) 
  {
      return gd.onTouchEvent(event);//return the double tap events
  }
  
  @Override
  public boolean onDown(MotionEvent e) 
  {
      return false;
  }
  
  @Override
  public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) 
  {
  
      try {
          if (Math.abs(e1.getY() - e2.getY()) &gt; SWIPE_MAX_OFF_PATH)
          {
               return false;
          }
  
          if(e1.getX() - e2.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {
               tvTap.setText("Flip Right to Left");
               Log.v(TAG, "Right to Left");
          }  else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {
              tvTap.setText("Flip Left to Right");
               Log.v(TAG, "Left to Right");
          }
      } catch (Exception e)
      {
  
      }
      return false;
  }
  
  @Override
  public void onLongPress(MotionEvent e) 
  {
  }
  
  @Override
  public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) 
  {
      return false;
  }
  
  @Override
  public void onShowPress(MotionEvent e) 
  {
  }
  
  @Override
  public boolean onSingleTapUp(MotionEvent e) 
  {
      return false;
  }
  }
  </code></pre>
  
  <p>main.xml</p>
  
  <blockquote>
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical"&gt;
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center_horizontal"
      android:text="@string/hello"
      android:textStyle="bold" /&gt;
  &lt;TextView
      android:id="@+id/tvTap"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginTop="20dip" &gt;
  &lt;/TextView&gt;
  &lt;TextView
      android:id="@+id/tvTapEvent"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginTop="10dip" &gt;
  &lt;/TextView&gt;
  &lt;ScrollView
      android:id="@+id/scroll"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical" &gt;
          &lt;Button
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:text="Button1" /&gt;
          &lt;Button
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:text="Button2" /&gt;
          &lt;Button
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:text="Button3" /&gt;
          &lt;Button
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:text="Button4" /&gt;
          &lt;Button
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:text="Button5" /&gt;
          &lt;Button
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:text="Button6" /&gt;
          &lt;Button
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:text="Button7" /&gt;
          &lt;Button
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:text="Button8" /&gt;
          &lt;Button
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:text="Button9" /&gt;
          &lt;Button
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:text="Button10" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
    
    <p></p>
  </blockquote>
  
  <p>does anybody know how to implement the onFling() event on Scrollview ??</p>