title: Android - GridView - GestureDetector doesn't work
body: <p>I have a problem with detecting fling gestures in my app.
  My layout consists of a GridView, couple of TextViews and buttons. </p>
  
  <p>I implemented OnGestureListener:</p>
  
  <pre><code>public class MyActivity extends Activity implements OnGestureListener{
  private GestureDetector myGesture ;
  </code></pre>
  
  <p>then in OnCreate:</p>
  
  <pre><code>myGesture = new GestureDetector(this);
  </code></pre>
  
  <p>and Overridden methods:</p>
  
  <pre><code>@Override
  public boolean onTouchEvent(MotionEvent event){
      return myGesture.onTouchEvent(event);
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>@Override
  public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
          float velocityY) {
      // TODO Auto-generated method stub
      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) {
              //right to left fling
          }  else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {
              //left to right fling
          }
      } catch (Exception e) {
          // nothing
      }
      return false;
  }
  </code></pre>
  
  <p>And this actually works great, but NOT on the GridView. Wherever outside the GridView I perform the fling, it works. On the GridView - there's absolutely no reaction.
  I have literally no idea, what to do about it, so thanks for any help in advance.</p>