title: getSupportFragmentManager VS getChildFragmentManager
body: <p>I want to create fragment in activity.
  I have 4 fragment in 1 activity
  I have a code like this</p>
  
  <pre><code>private void setupViewPager(ViewPager viewPager) {
      ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
      adapter.addFragment(new fragment_invoice(), "Invoice");
      adapter.addFragment(new fragment_sales_order(), "Sales Order");
      adapter.addFragment(new fragment_achievement(), "Achievement");
      adapter.addFragment(new fragment_approval(), "Approval");
      viewPager.setAdapter(adapter);
  }
  
  class ViewPagerAdapter extends FragmentPagerAdapter {
      private final List&lt;Fragment&gt; mFragmentList      = new ArrayList&lt;&gt;();
      private final List&lt;String&gt; mFragmentTitleList   = new ArrayList&lt;&gt;();
  
      public ViewPagerAdapter(FragmentManager manager) {
          super(manager);
      }
  
      @Override
      public Fragment getItem(int position) {
          return mFragmentList.get(position);
      }
  
      @Override
      public int getCount() {
          return mFragmentList.size();
      }
  
      public void addFragment(Fragment fragment, String title) {
          mFragmentList.add(fragment);
          mFragmentTitleList.add(title);
      }
  
      @Override
      public CharSequence getPageTitle(int position) {
          return mFragmentTitleList.get(position);
      }
  
  }
  </code></pre>
  
  <p>I am has been success to show fragment
  but when I open other fragment for example
  1. open fragment_invoice
  2. move to fragment_achievement
  3. I go back to fragment_invoice and then all data will be lost but in fragment_sales_order not.
  4. It was happen to if I open fragment_sales_order
  5. Move to fragment_approval and then all data in fragment_sales_order will be lost.</p>
  
  <p>Why data in fragment lost with odd even fragment ?</p>
  
  <p>I was research about this and maybe give me some idea for use getchildfragmentmanager.
  <a href="https://stackoverflow.com/questions/35090867/getchildfragmentmanager-cannot-be-resolved-or-cannot-be-referenced">getChildFragmentManager () cannot be resolved or cannot be referenced</a></p>
  
  <p>for method getchildfragmentmanager must be extends to FragmentManager
  but my java class must extends AppCompatActivity. Cannot extends to FragmentManager because some data I get from http on extend to activity intent</p>
  
  <p>can someone help me to fix my fragment for show data always when I move to other fragment ?
  sorry if my question and my grammar weird
  감사합니다 여러번</p>