title: Swipe not Working in android ViewPager using FragmentPagerAdapter
body: <p>I want to create a swipe application for this I am using <code>ViewPager</code> in Android. When I run the code below, it runs successfully and a blue colored <code>Fragment</code> is opened, but swipe is not working on this. Can you tell me why? </p>
  
  <p>This is the my <code>Activity</code>: </p>
  
  <pre><code>package app.learn.com.learnapp;
  
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentActivity;
  import android.support.v4.view.ViewPager;
  
  import android.os.Bundle;
  
  import java.util.List;
  import java.util.Vector;
  
  import menulistFrag.blueColor;
  import menulistFrag.greenColor;
  import menulistFrag.redColor;
  
  
  public class MenuActivityList1 extends FragmentActivity {
  
      ViewPager viewPager;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_menu_activity_list1);
          viewPager = (ViewPager)findViewById(R.id.pager);
  
          instantiateFrags();
  
  
  
      }
      public  void instantiateFrags(){
          List&lt;Fragment&gt; frags = new Vector&lt;Fragment&gt;();
          frags.add(Fragment.instantiate(this, redColor.class.getName()));
          frags.add(Fragment.instantiate(this, greenColor.class.getName()));
          frags.add(Fragment.instantiate(this, blueColor.class.getName()));
          PagerAdapter pagerAdapter = new PagerAdapter(getSupportFragmentManager(),frags);
          viewPager.setAdapter(pagerAdapter);
          viewPager.setCurrentItem(0);
      }
  }
  </code></pre>
  
  <p>This is my <code>PagerAdapter</code>:    </p>
  
  <pre><code>package app.learn.com.learnapp;
  
  
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentManager;
  import android.support.v4.app.FragmentPagerAdapter;
  
  import java.util.List;
  
  import menulistFrag.blueColor;
  import menulistFrag.greenColor;
  import menulistFrag.redColor;
  
  /**
   * Created by root on 13/9/15.
   */
  
  public class PagerAdapter extends FragmentPagerAdapter {
      List&lt;Fragment&gt; fragments;
      public PagerAdapter(FragmentManager fm,List&lt;Fragment&gt; fragLists){
          super(fm);
          fragments =fragLists;
      }
      @Override
      public Fragment getItem(int position) {
     return fragments.get(position);
      }
  
      @Override
      public int getCount() {
          return 3;
  
      }
  }
  </code></pre>
  
  <p>I have three fragments:</p>
  
  <ul>
  <li><p>redColor.java</p></li>
  <li><p>greenColor.java</p></li>
  <li><p>blueColor.java</p></li>
  </ul>
  
  <p>And this is my layout file:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"&gt;
  &lt;android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/pager"&gt;
  
  &lt;/android.support.v4.view.ViewPager&gt;
  &lt;/LinearLayout&gt;
  </code></pre>