title: Attempt to invoke virtual method 'android.os.Handler android.support.v4.app.FragmentHostCallback.getHandler()' on a null object reference
body: <p>My Application consist of 4 fragment as tabs being loaded inside a parent Fragment using <code>FragmentPagerAdapter</code>.</p>
  
  <p>The problem is when I run the app and press back and re-open the app I receive this error log:</p>
  
  <pre><code>FATAL EXCEPTION: main
  java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Handler android.support.v4.app.FragmentHostCallback.getHandler()' on a null object reference
      at android.support.v4.app.FragmentManagerImpl.ensureExecReady(FragmentManager.java:1949)
      at android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:1965)
      at android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:620)
      at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:143)
      at android.support.v4.view.ViewPager.setAdapter(ViewPager.java:513)
      ...
  </code></pre>
  
  <p>the line of code inside parent Fragment is:</p>
  
  <pre><code>viewPager.setAdapter(adapter);
  tabLayout.setupWithViewPager(viewPager);
  </code></pre>
  
  <p>and <code>ViewPage</code> and <code>Adapter</code> both are not null!!</p>
  
  <p>I have to mention that all my <code>Fragment</code>s lifecycle is being managed  and the null issue is happening inside the adapter!, and the same Adapter is working fine when I use an <code>Activity</code> as parent instead of <code>Fragment</code>!!!</p>