title: ListView with Viewpager as a header inside TabPageIndicator
body: <p>so I made a Fragment Activity that contains Viewpager with TabPageIndicator to swipe from fragment to another and in each fragment I made a ListView that contains a ViewPager as a Header view the problem is the viewPager doesn't swipe even if I disbale the main viewPager swipping </p>
  
  <p>I tried same thing with ActionBar tabs but it didn't work either </p>
  
  <p><img src="https://i.stack.imgur.com/DLq9t.png" alt="enter image description here"> </p>
  
  <p>here's my fragment Activity</p>
  
  <pre><code>public class SampleTabsStyled extends FragmentActivity {
  
  private static final String[] CONTENT = new String[] { "Recent", "Artists",
          "Albums", "Songs", "Playlists", "Genres" };
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.simple_tabs);
  
      FragmentPagerAdapter adapter = new GoogleMusicAdapter(
              getSupportFragmentManager());
  
      final ViewPager pager = (ViewPager) findViewById(R.id.pager);
      pager.setAdapter(adapter);
  
      pager.setOnTouchListener(new OnTouchListener() {
  
          @Override
          public boolean onTouch(View v, MotionEvent event) {
              // TODO Auto-generated method stub
  
              switch (event.getAction()) {
              case MotionEvent.ACTION_MOVE:
                  pager.requestDisallowInterceptTouchEvent(true);
                  break;
              case MotionEvent.ACTION_UP:
              case MotionEvent.ACTION_CANCEL:
                  pager.requestDisallowInterceptTouchEvent(false);
                  break;
  
              }
              return true;
          }
  
      });
  
      TabPageIndicator indicator = (TabPageIndicator) findViewById(R.id.indicator);
      indicator.setViewPager(pager);
  
  }
  
  class GoogleMusicAdapter extends FragmentPagerAdapter {
      public GoogleMusicAdapter(FragmentManager fm) {
          super(fm);
      }
  
      @Override
      public ListFragment getItem(int position) {
          // return TestFragment.newInstance(CONTENT[position %
          // CONTENT.length]);
          return new SecondTestFragment();
      }
  
      @Override
      public CharSequence getPageTitle(int position) {
          return CONTENT[position % CONTENT.length].toUpperCase();
      }
  
      @Override
      public int getCount() {
          return CONTENT.length;
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and here's my ListFragment</p>
  
  <pre><code>public class SecondTestFragment extends ListFragment {
  
  String[] countries = new String[] { "India", "Pakistan", "Sri Lanka",
          "China", "Bangladesh", "Nepal", "Afghanistan", "North Korea",
          "South Korea", "Japan" };
  
  View mheaderView;
  ViewPager pager;
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      /** Creating an array adapter to store the list of countries **/
  
      View parent = inflater.inflate(R.layout.fragment_list, null);
  
      // mheaderView = inflater.inflate(R.layout.item_list, null);
      mheaderView = inflater.inflate(R.layout.featured_pager, null);
      pager = (ViewPager) mheaderView.findViewById(R.id.featuredPaper);
      pagerAdapter pa = new pagerAdapter(getActivity());
      pager.setAdapter(pa);
      pager.setOnTouchListener(new OnTouchListener() {
  
          @Override
          public boolean onTouch(View v, MotionEvent event) {
              // TODO Auto-generated method stub
              Log.d("Motion Event", event.toString());
              return false;
          }
      });
  
      CirclePageIndicator indicator = (CirclePageIndicator) mheaderView.findViewById(R.id.featured_indicator);
      indicator.setViewPager(pager);
  
  
  
  
      return parent;
  }
  
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onActivityCreated(savedInstanceState);
  
      if (mheaderView != null) {
          this.getListView().addHeaderView(mheaderView);
          Log.d("pager", "not null");
      } else {
          Log.d("pager", "null");
      }
  
      ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(getActivity(),
              android.R.layout.simple_list_item_1, countries);
      setListAdapter(adapter);
  
      getListView().setOnTouchListener(new View.OnTouchListener() {
  
          @Override
          public boolean onTouch(View v, MotionEvent event) {
              getListView().getParent().requestDisallowInterceptTouchEvent(true);
              return false;
          }
      });
  
      ((PullToRefreshListView) getListView()).setOnRefreshListener(new OnRefreshListener() {
          @Override
          public void onRefresh() {
              // Do work to refresh the list here.
  
          }
      });
  
  
  }
  </code></pre>
  
  <p>}</p>