title: Using ViewPager with include layout
body: <p>I don't know if this is a bug or if I'm just not supposed to do things this way but I am trying to include a viewpager twice on a page and the second viewpager never shows up.</p>
  
  <p>ActivityMain.java</p>
  
  <pre><code>//These are my two includes in activity_main
  View includeOne = findViewById(R.id.activity_main_include_primary);
  View includeTwo = findViewById(R.id.activity_main_include_secondary);
  
  //Set viewpager one
  ViewPager pagerOne = (ViewPager) includeOne.findViewById(R.id.pager_viewpager);
  CustomAdapter adapterOne = new CustomAdapter(getSupportFragmentManager());
  pagerOne.setAdapter(adapterOne);
  
  //set viewpager two
  ViewPager pagerTwo = (ViewPager) includeTwo.findViewById(R.id.pager_viewpager);
  CustomAdapter adapterTwo = new CustomAdapter(getSupportFragmentManager());
  pagerTwo.setAdapter(adapterTwo);
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;include
      android:id="@+id/activity_main_include_primary"
      layout="@layout/pager"/&gt;
  
  &lt;include
      android:id="@+id/activity_main_include_secondary"
      layout="@layout/pager"/&gt;
  </code></pre>
  
  <p>pager.xml</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" &gt;
  
      &lt;android.support.v4.view.ViewPager
          android:id="@+id/pager_viewpager"
          android:layout_width="match_parent"
          android:layout_height="200dp" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>CustomAdapter.java</p>
  
  <pre><code>public class CustomAdapter extends FragmentPagerAdapter  {
  
      public CustomAdapter(FragmentManager fm) {
          super(fm);
      }
  
      @Override
      public int getCount() {
          return 2;
      }
  
      @Override
      public Fragment getItem(int position) {
          switch(position){
              case 0:
                  return FragmentOne.newInstance();
              default:
                  return FragmentTwo.newInstance();
          }
      }
  }
  </code></pre>
  
  <p>The two fragments are standard.</p>
  
  <p>I've been trying this all day and just can't get the second viewpager to show unless I ditch the include (which I don't want to do). Any other android view I used works fine.</p>
  
  <p>Any help would be much appreciated.</p>