title: onfling() not being called for some reason
body: <p>I'm trying to implement gesture in my app and for some reason the the onfling() is not being called. I tried reading numerous posts regarding this and tried fixing my code but it's not working . The below is my code. Please have a look:</p>
  
  <pre><code>public class MainMenuSlider extends Activity implements OnClickListener{
  
  protected MyGestureListener myGestureListener;
  
  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;
  
  private ViewFlipper vf;
  private Animation animFlipInNext,animFlipOutNext, animFlipInPrevious, animFlipOutPrevious;
  
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.mainmenuslider);
      myGestureListener = new MyGestureListener(this);
  
      //vf for viewflipper
      vf=(ViewFlipper)findViewById(R.id.ViewFlipper01);
      animFlipInNext = AnimationUtils.loadAnimation(this, R.anim.flipinnext);
      animFlipOutNext = AnimationUtils.loadAnimation(this, R.anim.flipoutnext);
      animFlipInPrevious = AnimationUtils.loadAnimation(this, R.anim.flipinprevious);
      animFlipOutPrevious = AnimationUtils.loadAnimation(this, R.anim.flipoutprevious);
  
      imageone = (ImageView) findViewById(R.id.imageone);
      imagetwo = (ImageView) findViewById(R.id.imagetwo);
      imageone.setOnClickListener(myGestureListener);
      imagetwo.setOnClickListener(myGestureListener);
  
  
  } 
  
  
  class MyGestureListener extends SimpleOnGestureListener implements OnTouchListener
      {
          Context context;
          GestureDetector gDetector;
  
      public MyGestureListener()
      {
          super();
      }
  
      public GestureDetector getDetector()
      {
          return gDetector;
      } 
  
      public MyGestureListener(Context context) 
      {
          this(context, null);
      }
  
      public MyGestureListener(Context context, GestureDetector gDetector) 
      {
  
          if(gDetector == null)
              gDetector = new GestureDetector(context, this);
  
          this.context = context;
          this.gDetector = gDetector;
      }
  
      public boolean onDown(MotionEvent event) 
      {
          return true;
      }
  
  
      @Override
      public boolean onFling(MotionEvent e1,MotionEvent e2,float velocityX,float velocityY)
      {
          try {
              if(e1.getX() &gt; e2.getX() &amp;&amp; Math.abs(e1.getX() - e2.getX()) &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {
                  vf.setInAnimation(animFlipInPrevious);
                  vf.setOutAnimation(animFlipOutPrevious);
                  vf.showPrevious();
              }else if (e1.getX() &lt; e2.getX() &amp;&amp; e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {
                  vf.setInAnimation(animFlipInNext);
                  vf.setOutAnimation(animFlipOutNext);
                  vf.showNext();
              }
          } catch (Exception e) {
              // nothing
          }
          return true;
  
      }
  
      @Override
      public boolean onSingleTapConfirmed(MotionEvent e) 
      {
  
          return super.onSingleTapConfirmed(e);
      }
  
      public boolean onTouch(View v, MotionEvent event) 
      {
  
          // Within the MyGestureListener class you can now manage the event.getAction() codes.
  
          // Note that we are now calling the gesture Detectors onTouchEvent. And given we've set this class as the GestureDetectors listener 
          // the onFling, onSingleTap etc methods will be executed.
          return gDetector.onTouchEvent(event);
      }
  
  
      public void onClick(View v) 
      {
          if (v == imageone)
          {
              Intent j = new Intent(getApplicationContext(), MainActivity.class);
              j.putExtra("slideindex", 0);
              startActivity(j);
          }
  
          if (v == imagetwo)
          {
              Intent j = new Intent(getApplicationContext(), MainActivity.class);
              j.putExtra("slideindex", 1);
              startActivity(j);
          }
      }
  
      public boolean onScroll(MotionEvent e1,MotionEvent e2,float distanceX,float distanceY)
      {
          return true;
      }
  
  
    }
  }
  </code></pre>
  
  <p><strong>EDIT: Here is the mainmenuslider XML file content as requested</strong></p>
  
  <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="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:background="#291E3D" &gt;
  
              &lt;ScrollView android:layout_width="fill_parent"
                            android:layout_height="fill_parent"
                            android:orientation="vertical" &gt;
  
                      &lt;LinearLayout android:layout_width="fill_parent"
                                    android:layout_height="fill_parent"
                                    android:gravity="center"
                                    android:orientation="vertical" &gt;
  
                              &lt;ViewFlipper android:id="@+id/ViewFlipper01"
                                                   android:layout_height="wrap_content" 
                                                   android:layout_width="fill_parent"
                                                   android:gravity="center" &gt;
  
                                      &lt;!-- adding views to ViewFlipper --&gt; 
  
                                              &lt;!-- First Slide --&gt; 
                                              &lt;LinearLayout android:layout_width="fill_parent"
                                                            android:layout_height="fill_parent"
                                                            android:gravity="center"
                                                            android:orientation="vertical" &gt;
  
  
                                                      &lt;TextView android:id="@+id/title1"
                                                                android:text="title1" 
                                                                android:textColor="#ffffff"
                                                                android:layout_width="fill_parent" 
                                                                android:layout_height="wrap_content" 
                                                                android:gravity="center"
                                                                android:layout_marginBottom="3dip"
                                                                android:textSize="25dip"/&gt;
  
  
                                                      &lt;ImageView android:id="@+id/imageone" 
                                                                 android:clickable="true"
                                                                 android:layout_width="wrap_content" 
                                                                 android:layout_height="wrap_content" 
                                                                 android:src="@drawable/splash_screen"&gt;
                                                      &lt;/ImageView&gt;
  
  
                                              &lt;/LinearLayout&gt;
  
                                              &lt;!-- Second Slide --&gt; 
                                              &lt;LinearLayout android:layout_width="fill_parent"
                                                            android:layout_height="fill_parent"
                                                            android:gravity="center"
                                                            android:orientation="vertical" &gt;
  
  
                                                      &lt;TextView android:id="@+id/title2"
                                                                android:text="title2" 
                                                                android:textColor="#ffffff"
                                                                android:layout_width="fill_parent" 
                                                                android:layout_height="wrap_content"
                                                                android:gravity="center"
                                                                android:layout_marginBottom="3dip"
                                                                android:textSize="25dip" /&gt;
  
  
                                                      &lt;ImageView android:id="@+id/imagetwo"
                                                                 android:clickable="true"
                                                                 android:layout_width="wrap_content" 
                                                                 android:layout_height="wrap_content" 
                                                                 android:src="@drawable/sunnahsplash"&gt;
                                                      &lt;/ImageView&gt;
  
  
                                              &lt;/LinearLayout&gt;
  
  
  
                                      &lt;/ViewFlipper&gt;
  
  
  
  
  
                              &lt;!-- footer --&gt;
                              &lt;LinearLayout android:id="@+id/LinearLayout03"
                                            android:layout_height="wrap_content" 
                                            android:layout_width="wrap_content" 
                                            android:orientation="horizontal" 
                                            android:layout_gravity="center"
                                            android:layout_marginTop="10dip"&gt;
  
                                              &lt;Button android:id="@+id/Button02" 
                                                      android:layout_height="wrap_content" 
                                                      android:text="&amp;lt;Previous" 
                                                      android:textSize="18dip"
                                                      android:layout_width="wrap_content" 
                                                      android:layout_gravity="center"
                                                      android:layout_marginRight="15dip"
                                                      android:padding="5dp"
                                                      android:background="@drawable/background_button_slider"&gt;&lt;/Button&gt;
                                              &lt;Button android:id="@+id/Select" 
                                                      android:text=" Select " 
                                                      android:textSize="18dip"
                                                      android:layout_height="match_parent" 
                                                      android:layout_width="wrap_content" 
                                                      android:layout_gravity="center"
                                                      android:padding="5dp"
                                                      android:background="@drawable/background_button_slider"&gt;&lt;/Button&gt;
                                              &lt;Button android:id="@+id/Button01" 
                                                      android:text=" Next&amp;gt;" 
                                                      android:textSize="18dip"
                                                      android:layout_height="match_parent" 
                                                      android:layout_width="wrap_content" 
                                                      android:layout_gravity="center"
                                                      android:layout_marginLeft="15dip"
                                                      android:padding="5dp"
                                                      android:background="@drawable/background_button_slider"&gt;&lt;/Button&gt;
                              &lt;/LinearLayout&gt;
  
                      &lt;/LinearLayout&gt;
  
              &lt;/ScrollView&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>