title: No view found for id 0x for fragment after rotation?
body: <p>I'm loading some fragments in a container, which holds a Navigation Drawer too.
  When rotating the screen, and then rotating it back, the app crashes:</p>
  
  <blockquote>
    <p>java.lang.RuntimeException: Unable to start activity
    ComponentInfo{lu.gian.uniwhere.alfa/com.example.alfa.ActivityHome}:
    java.lang.IllegalArgumentException: No view found for id 0x7f0b004e
    (com.example.alfa:id/taxes_pager) for fragment
    FragmentTaxToBePaid{b5969898 #2 id=0x7f0b004e}</p>
  </blockquote>
  
  <p>I got this error when <strong>rotating back</strong> to portrait mode, after going landscape. What's fun is that I'm not loading <code>FragmentTaxes</code> (that is, <em>N.B.</em>., a <code>ViewPager</code>), but totally another fragment (<em>FragmentOverwiew</em> - nothing special to note about it)!</p>
  
  <p>It throws the exactly same error when rotating back from FragmentSession, which is a <code>ViewPager</code> holder too:</p>
  
  <blockquote>
    <p>java.lang.RuntimeException: Unable to start activity
    ComponentInfo{lu.gian.uniwhere.alfa/com.example.alfa.ActivityHome}:
    java.lang.IllegalArgumentException: No view found for id 0x7f0b000f
    (com.example.alfa:id/session_pager) for fragment
    FragmentSessionApplied{b5afa300 #1 id=0x7f0b000f}</p>
  </blockquote>
  
  <p>I've tried <strong>everything</strong> out there (not retaining instances of the fragments, putting them in the back stack, replacing <code>Frame</code> xml tag with <code>FrameLayout</code>, creating a specific layout for then landscape mode, etc, etc), but hardly anything sorted an effect.
  I think it's due to fragments lifecycle, because crashes are inconstant and difficult to debug, but it's quite hard to understand how to fix this sort of problem.</p>
  
  <p><strong>ActivityHome</strong></p>
  
  <pre><code>public void selectItem(int position) {
          // ...
      FragmentManager fragmentManager = getSupportFragmentManager();
      fragmentManager.beginTransaction()
                      .addToBackStack(null)
                      .replace(R.id.content_frame, fragment)
                      .commit();
      mDrawerList.setItemChecked(position, true);
      setTitle(mDrawerTitles[position]);
      mDrawerLayout.closeDrawer(mDrawerList);
  }
  </code></pre>
  
  <p><strong>activity_home</strong></p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout
      ... &gt;
  
      &lt;FrameLayout
          android:id="@+id/content_frame"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
  
      &lt;!-- The navigation drawer  .... --&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p><strong>FragmentTaxes</strong></p>
  
  <pre><code>    View rootView = inflater.inflate(R.layout.fragment_taxes, container, false);
  </code></pre>
  
  <p><strong>fragment_taxes</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout
      ... &gt;
  
      &lt;!-- Loader --&gt;
      &lt;include
          android:id="@+id/taxes_main_progress"
          layout="@layout/indeterminate_activity_bar" /&gt;
  
      &lt;android.support.v4.view.ViewPager
          android:visibility="gone"
          android:id="@+id/taxes_pager"
          ... &gt;
  
          &lt;android.support.v4.view.PagerTabStrip
              android:id="@+id/taxes_pager_tab_strip"
              ... /&gt;
      &lt;/android.support.v4.view.ViewPager&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>If needed I will post more snippets of code. Now I don't, I think it can result confusing for reading.</p>