title: Android - Fragment screen rotate
body: <p>I'have 1 FragmentActivity with a ViewPager which handle 2 Fragments.</p>
  
  <p><pre></p>
  
  <p>public class MyFragmentActivity extends FragmentActivity{</p>
  
  <code>private Fragment f1;
  private Fragment f2;
  private ViewPager myPager;
  private MyFragmentAdapter mFragmentsAdapter;
  private static ArrayAdapter&lt;Fragment&gt; mFragmentArray;
  
  public void onCreate(Bundle icicle) {
      super.onCreate(icicle); 
  setContentView(R.layout.my_layout); 
  myViewPager = (ViewPager) findViewById(R.id.pager_acciones);
  
  mFragmentArray = new ArrayAdapter&lt;Fragment&gt;(getApplicationContext(),android.R.layout.simple_list_item_1);
  f1 = new Fragment();
      f1 = new Fragment();
  
  mFragmentArray.add(f1);
  mFragmentArray.add(f2);
  
  mFragmentsAdapter = new MyFragmentAdapter(getSupportFragmentManager());
  myPager.setAdapter(mFragmentsAdapter);
  myPartidoPager.setCurrentItem(0);
  
  
  }
  
  
  public static class MyFragmentAdapter extends FragmentPagerAdapter {
      public AccionesFragmentAdapter(FragmentManager fm) {
          super(fm);
      }
  
      @Override
      public int getCount() {
  
          return mFragmentArray.getCount();
      }
  
      @Override
      public Fragment getItem(int position) {
  
          return mFragmentArray.getItem(position);
      }
  
  
  }
  </code></pre>
  
  <p></p>
  
  <p>My problem is that every time the screen orientation changes, the activity is created and also the Fragments. I don't mind if the activity is created again, but I don't want the Fragments to be recreated. </p>