title: Keeping an activity from re-creating my fragments on orientation change
body: <p>I have an activity that holds a fragment, when something on that fragment gets clicked i replace that fragment with another fragment. If the device is rotated with in the second fragment then the <code>onCreate</code> gets called for the activity and recreates the first fragment again.</p>
  
  <p>How can I stop the onCreate from getting called when the device rotates?</p>
  
  <p>in my manifest i have this</p>
  
  <pre><code>&lt;activity android:name="CalActivity" android:configChanges="orientation|keyboardHidden"/&gt;
  </code></pre>
  
  <p>it is my understanding that adding in the configChanges to that activity prevents the activity from being destroyed and recreated but the onCreate still gets called and messes up the fragments.</p>
  
  <p>I also tried putting in <code>setRetainInstance()</code> in the fragments and that didnt help either</p>
  
  <p>if the device does not rotate the the fragments work like they should and I dont want to make this a one orientation only activity, thats more of a hack than actually fixes the problem</p>
  
  <p>What else can I do?</p>
  
  <p>EDIT:</p>
  
  <p>this is how I create my fragments</p>
  
  <pre><code>Fragment miniMonthFrag = new MonthByWeekFragment(System.currentTimeMillis(), false);
  ft.replace(R.id.cal_frame, miniMonthFrag).commit();
  </code></pre>