title: Android Fragments orientation problem
body: <p>i have implemented different layouts for a fragment for portrait and landscape orientation.</p>
  
  <p>I have a TabActivity with 3 tabs that have the fragments in them.</p>
  
  <p>I have then implemented the onConfigurationChanged method of the Fragment and in there i am removing the current Fragment and readding it (the only way to let it inflate the correct layout, right?).</p>
  
  <p>Unfortunately this only seems to be working for the currently visible Fragment.</p>
  
  <p>Example:
  1) All Fragments are initialized with portrait layout, everything is fine
  2) I change to landscape
  3) Visible Fragment changes fine, landscape layout is loaded
  4) The two Fragments that were not visible when the orientation change happended have loaded their portrait layouts</p>
  
  <p>On all three Fragments, the onCreateView method has been called.</p>
  
  <p>Any ideas why invisible Fragments behave different then visible Fragments?</p>
  
  <p>This is the code that i am using:</p>
  
  <pre><code>@Override
  public void onConfigurationChanged(Configuration newConfig) {
      super.onConfigurationChanged(newConfig);
      Log.d("PhotoFragment", "onConfigurationChanged");
      FragmentTransaction transaction = getFragmentManager()
              .beginTransaction();
      transaction.remove(this);
      transaction.add(R.id.fragment_container, new PhotoFragment(mPhoto));
      transaction.addToBackStack(null);
      transaction.commit();
      getFragmentManager().popBackStack();
  }
  </code></pre>