title: Android when my app switches orientation 2+ times I get nullPointerException
body: <p>In my app there is 1 Activity(Activity A) and 3 Fragments (Frag B, Frag C, Frag D).  The process goes Activity A -> Frag B -> Frag C -> Frag D.  My app can do screen orientations but when I am on Frag D or Frag C and I do 1 screen orientation change its fine and the app still works.  Its when I  do 2+ screen orientation changes my savedInstanceState and everything that I have saved in my Activity A becomes null and I get a nullPointerException, so when I click "back" to go to the previous fragment the app crashes.  </p>
  
  <p>I can't really put my finger on why this is happening but hopefully someone might have an idea as to why this is happening, I would think that if 1 screen orientation works then why would the second one do this?  It doesn't matter if I start in landscape or portrait but its just when 2+ orientation changes happen.  I am not too sure what code to put in here without making this very lengthy.</p>
  
  <p>EDIT. LOGCAT:</p>
  
  <pre><code>11-12 20:44:46.637: I/Activity A(998): onStart
  11-12 20:44:46.637: I/Activity A(998): onResume
  11-12 20:46:18.947: I/Frag B(998): onCreateView
  11-12 20:46:19.157: I/Frag B(998): onStart
  11-12 20:46:19.157: I/Frag B(998): onResume
  11-12 20:46:23.057: I/Frag B(998): onPause
  11-12 20:46:23.067: I/Frag B(998): onStop
  11-12 20:46:23.067: I/Frag C(998): onCreateView
  11-12 20:46:23.327: I/Frag C(998): onStart
  11-12 20:46:23.327: I/Frag C(998): onResume
  11-12 20:46:25.507: I/Frag C(998): onPause
  11-12 20:46:25.507: I/Frag C(998): onStop
  11-12 20:46:25.527: I/Frag D(998): onCreateView
  11-12 20:46:29.466: I/Frag D(998): onStart
  11-12 20:46:29.466: I/Frag D(998): onResume
  
  //First screen rotation.
  
  11-12 20:46:52.907: I/Frag D(998): onPause
  11-12 20:46:52.907: I/Activity A(998): onPause
  11-12 20:46:52.907: I/System.out(998): savedInstanceState in Frag C = Bundle[{LibraryChoice=Fighter}]
  11-12 20:46:52.907: I/System.out(998): savedInstanceState in Frag D = Bundle[{LibraryChoice=Fighter, LibraryChoiceSelected=FighterSelected}]
  11-12 20:46:52.947: I/Frag D(998): onStop
  11-12 20:46:52.947: I/Activity A(998): onStop
  11-12 20:46:52.957: I/Frag B(998): onDestroy
  11-12 20:46:52.957: I/Frag C(998): onDestroy
  11-12 20:46:53.037: I/Frag D(998): onDestroy
  11-12 20:46:53.037: I/Activity A(998): onDestroy
  11-12 20:46:53.667: I/Frag D(998): onCreateView
  11-12 20:46:57.127: I/Frag D(998): onStart
  11-12 20:46:57.127: I/Activity A(998): onStart
  11-12 20:46:57.147: I/Activity A(998): onResume
  11-12 20:46:57.147: I/Frag D(998): onResume
  
  //Second screen rotation.
  
  11-12 20:47:05.697: I/Frag D(998): onPause
  11-12 20:47:05.697: I/Activity A(998): onPause
  11-12 20:47:05.697: I/System.out(998): savedInstanceState in Frag C = Bundle[{LibraryChoice=null}]
  11-12 20:47:05.697: I/System.out(998): savedInstanceState in Frag D = Bundle[{LibraryChoice=Fighter, LibraryChoiceSelected=FighterSelected}]
  11-12 20:47:05.737: I/Frag D(998): onStop
  11-12 20:47:05.737: I/Activity A(998): onStop
  11-12 20:47:05.747: I/Frag B(998): onDestroy
  11-12 20:47:05.747: I/Frag C(998): onDestroy
  11-12 20:47:05.867: I/Frag D(998): onDestroy
  11-12 20:47:05.867: I/Activity A(998): onDestroy
  11-12 20:47:06.457: I/Frag D(998): onCreateView
  11-12 20:47:09.907: I/Frag D(998): onStart
  11-12 20:47:09.907: I/Activity A(998): onStart
  11-12 20:47:09.917: I/Activity A(998): onResume
  11-12 20:47:09.917: I/Frag D(998): onResume
  
  //Back button pressed.
  
  11-12 20:47:19.696: I/Frag D(998): onPause
  11-12 20:47:19.696: I/Frag D(998): onStop
  11-12 20:47:19.707: I/Frag C(998): onCreateView
  11-12 20:47:19.977: D/AndroidRuntime(998): Shutting down VM
  11-12 20:47:20.017: E/AndroidRuntime(998): FATAL EXCEPTION: main
  11-12 20:47:20.017: E/AndroidRuntime(998): java.lang.NullPointerException
  11-12 20:47:20.017: E/AndroidRuntime(998): at j.l.ls11.FragB.onCreateView(FragB.java:99)
  </code></pre>
  
  <p>Anyone know how to get my Frag C to not be null?</p>