title: ViewPager getChildAt() returns null
body: <p>I am using ViewPager in my activity and it only has two fragments, both implemented in similar structure as follow, so there should always be a fragment returned when getInstanced is called:</p>
  
  <pre><code>public class ListReminderFragment extends Fragment {
  
      private View rootView;
  
      private static ListReminderFragment listReminderFragment;
  
      public static ListReminderFragment getInstance() {
          if(listReminderFragment != null)
              return listReminderFragment;
          else {
              listReminderFragment = new ListReminderFragment();
              return listReminderFragment;
          }
      }
  
      @Nullable
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          rootView = inflater.inflate(R.layout.content_main_screen, container, true);
          return rootView;
      }
  
      @Nullable
      @Override
      public View getView() {
          return rootView;
      }
  }
  </code></pre>
  
  <p>This is my adapter:</p>
  
  <pre><code>public class ViewPagerAdapter extends FragmentPagerAdapter {
  
  public ViewPagerAdapter(FragmentManager fm) {
      super(fm);
  }
  
  @Override
  public Fragment getItem(int position) {
      return ListReminderFragment.getInstance();    // temporary
  }
  
  @Override
  public int getCount() {
      return 2;
  }
  }
  </code></pre>
  
  <p>And I am initialising my ViewPager as below, in OnCreate() in the activity that has the ViewPager:</p>
  
  <pre><code>ViewPagerAdapter viewPagerAdapter = new ViewPagerAdapter(getSupportFragmentManager());
  ViewPager viewPager = (ViewPager) findViewById(R.id.main_view_pager);
  viewPager.setAdapter(viewPagerAdapter);
  </code></pre>
  
  <p>But when I call viewPager.getChildAt(), viewPagerAdapter.getItem(0).getView(), they both return null,</p>
  
  <p>when I call viewPager.getChildCount(), it returns 0 instead of 2. </p>
  
  <p>How should I access the views in side the fragment in ViewPager?</p>