title: Android: Fragments and onConfigurationChanged
body: <p>I have an activity that contains a single fragment, for reasons I won't go into right now, I handle most configuration changes so that the activity doesn't get recreated when for example the user rotates the screen.  The problem I'm running into is that the fragment views don't get recreated when the rotation happens.  The fragment uses the onCreateView method to supply the activity with its view and is added programmatically via the FragmentManager.</p>
  
  <p>I call the setContentView method in the activity's onConfigurationChanged method to reload the activities view, however, this never ends up calling the fragment's onCreateView method to get a new view (appropriate for the newly rotated screen).  That makes sense because the fragment was added manually via the code.  So I tried manually re-adding the fragment in the activity's onConfigurationChanged method, but still the fragment's onCreateView method doesn't get called.  Also I was under the assumption that the Android system automatically handles re-adding the fragment if you use the Fragment manager transaction system ... but I might be wrong on that.</p>
  
  <p>I'm assuming I'm missing something logic wise.  If anyone could shed some light that would be much appreciated.  Basically I just need to keep my activity and fragment around through configuration changes and need these to recreate their views when these changes happen.</p>
  
  <p>Thank you for any help,
  Harry</p>