title: Android Fragments not being recreated on Activity Restart
body: <p>I have an Activity which contains a couple of nested Fragments. I have been having a lot of trouble handling orientation changes. Something is not correct when the Activity tries to recreate itself which causes the app to crash. If I try to debug the code during an orientation change the app crashes without any messages in the logcat. </p>
  
  <p>My problem seems to be the the runtime is trying to recreate the fragments in my Activity when I don't want it to. None of the fragments have setRetainInstance(true) so they shouldn't be getting kept. </p>
  
  <p>I have added logging to the onCreate and onDestroy methods of the Activity and Fragments. When the app first runs I get the following output:</p>
  
  <pre><code>Activity onCreate
  Fragment1 onCreate
  Fragment1 onCreateViewStart
  Fragment1 onCreateViewEnd
  Fragment2 onCreate
  Fragment2 onCreateViewStart
  Fragment2 onCreateViewEnd
  </code></pre>
  
  <p>I then rotate the device and get the following:</p>
  
  <pre><code>Fragment1 onDestroy
  Fragment2 onDestroy
  Activity onDestroy
  Fragment1 onCreate
  Fragment2 onCreate
  Activity onCreate
  Fragment1 onCreateViewStart
  Fragment1 onCreateViewEnd
  Fragment2 onCreateViewStart
  Fragment2 onCreateViewEnd
  Fragment2 onDestroy
  Fragment2 onCreate
  </code></pre>
  
  <p>After the last message above the app crashes with the following exception message:</p>
  
  <pre><code>E/FragmentManager(32258): No view found for id 0x7f0a0047 (com.appName:id/fragmentHolder) for fragment Fragment2{6529b910 #6 id=0x7f0a0047 16002}
  </code></pre>
  
  <p>Why are my fragments being recreated automatically? Is there anything I can do to force the activity to reload as if the app was being started for the first time when the orientation changes? Is this not how the life cycle is supposed to work in the first place?</p>
  
  <p>I can add any code if requested.</p>