title: Fragments disappear
body: <p>I have a problem using Fragments in one of my applications. 
  The app consists of one main frame which content fragments are replaced when some buttons are pressed (Think of it as a tab-like layout). 
  So far everything works fine normally but sometimes the whole content of the fragments frame disappears after switching the fragment. One way to repair this is to press the app-switch button to bring the app into background and then bring the app back to foreground again. This seems to redraw the screen and i can see my fragments again.</p>
  
  <p>A view hierarchy dump gives me the same as can be seen on the screen so that the fragment frame is empty if the bug happens but when i check the layout in debug mode everything is working as expected. The fragments and views are replaced correctly but are not shown on the display.</p>
  
  <p>I already tried different ways of managing the fragments (as show/hide, replace, add/remove) and i tried to workaround it by hiding and showing or invalidating the complete view tree and disabling hardware acceleration but always with the same results. </p>
  
  <hr>
  
  <p>Edit: As requestet some Code Examples if the current versionbut i also tried adding all fragments first and then showing/hiding fragments with the same result:</p>
  
  <p>Adding First Fragment in onCreate of MainActivity (which extends FragmentActivity):</p>
  
  <pre><code>    final FragmentTransaction tx = getSupportFragmentManager().beginTransaction();
      tx.add(R.id.tabContent, new MyFirstTab());
      tx.commit();
  </code></pre>
  
  <p>Changing Fragments (ensured to be called from ui thread):</p>
  
  <pre><code>private void changeTab(final Fragment tab) {
  FragmentManager fm = getSupportFragmentManager();
  final FragmentTransaction tx = fm.beginTransaction();
  tx.replace(R.id.tabContent, tab);
  tx.commit();
  }
  </code></pre>