title: Android FragmentTransaction, ActionBar Tabs, and Multiple Fragments
body: <p>So, I am building a tablet app with the compatibility library and have run into an oddity I can't seem to figure out.  All in one activity, I have 2 tabs (Tab A and Tab B), and 3 Fragments (Fragments A1, A2, and B).  The ActionBar.TabListener associated with Tab A handles the adding and removing of Fragments A1 and A2, and the ActionBar.TabListener associated with Tab B handles the adding and removing of Tab B.  So far so good.</p>
  
  <p>The strange behavior is exhibited when I launch the activity (so Tab A is selected and Fragments A1 and A2 are displayed from left to right, correctly) click on Tab B (so Fragments A1 and A2 are removed and Fragment B is shown, still correctly) and then click back on Tab A!
  Now, Fragments A1 and A2 are showing, but in the reversed order: A2 and then A1!</p>
  
  <p>Has anyone experienced this oddity?  If I select Tab B and then Tab A again, they reverse again to be in the correct order, and the cycle continues.  According to <a href="http://developer.android.com/guide/topics/fundamentals/fragments.html" rel="nofollow">this article</a>, "If you're adding multiple fragments to the same container, then the order in which you add them determines the order they appear in the view hierarchy", which strangely doesn't seem to be the case now does it. </p>
  
  <p>Any ideas?  Thanks in advance!</p>