title: Gesture detector on custom view
body: <p>I have defined a class that extends <code>GestureDetector.SimpleOnGestureListener</code> and overrides the <code>onDown</code> and <code>onFling</code> methods </p>
  
  <pre><code>class MyGestureDetector extends GestureDetector.SimpleOnGestureListener {
  
      @Override
      public boolean onDown(MotionEvent e) {
          // TODO Auto-generated method stub
          return super.onDown(e);
      }
  
      @Override
      public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
              float velocityY) {
          // TODO Auto-generated method stub
  
          Toast.makeText(PersianDatePicker.this.getContext(),
                  "fling " + velocityX + " - " + velocityY, Toast.LENGTH_LONG)
                  .show();
  
          return super.onFling(e1, e2, velocityX, velocityY);
      }
  }
  </code></pre>
  
  <p>And I also defined an instance of <code>GestureDetectorCompat</code> </p>
  
  <pre><code>@Override
  public boolean onTouchEvent(MotionEvent event) {
  
      mDetector.onTouchEvent(event);
  
      return super.onTouchEvent(event);
  }
  </code></pre>
  
  <p>I tested it in an activity and it works well. I want to use it in a customized view but it doesn't work! And I have no error.</p>