title: move Android fragment to a different container Can't change container ID of fragment
body: <p>Here is what I would like my application to do on a tablet.
  Fragment (0) has some menu that would display fragments (1)...(n) like this:</p>
  
  <pre><code>-----------------
  |   |   |   |   |
  |   |   |   |   |
  |(0)| X | X | X |
  |   |   |   |   |
  |   |   |   |   |
  -----------------
   becomes
  -----------------
  |   |   |   |   |
  |   |   |   |   |
  |(0)|(1)| X | X |
  |   |   |   |   |
  |   |   |   |   |
  -----------------
   and then
  -----------------
  |   |   |   |   |
  |   |   |   |   |
  |(0)|(2)|(1)| X |
  |   |   |   |   |
  |   |   |   |   |
  -----------------
   etc... 
  </code></pre>
  
  <p>Fragment0 never moves, the other ones are shifted to the right. Fragments going off the edge to the right will be destroyed.</p>
  
  <p>So I setup my XML layout with a horizontal LinearLayout and containing 4 FrameLayout with the proper IDs (fragment0... fragment3)</p>
  
  <p>I can instantiate and display fragment0 and then fragment1, but I am not able to shift it to the right after, I get:</p>
  
  <pre><code>ERROR/AndroidRuntime(343): FATAL EXCEPTION: main
  java.lang.IllegalStateException: Can't change container ID of fragment ...
  </code></pre>
  
  <p>The only related questions I have found are <a href="https://stackoverflow.com/questions/9906254/illegalstateexception-cant-change-container-id-of-fragment">this one</a> and <a href="https://stackoverflow.com/questions/9092048/swap-two-fragment-simultaneously/9962906">that one</a>, tried all the different solutions offered with no luck.</p>
  
  <p>Tried <code>FragmentTransaction.remove()</code> followed by <code>.add()</code>, tried <code>.replace()</code>, tried them in different orders and to commit half-way through (even trying to commit twice as somebody suggested), tried to call <code>addToBackStack()</code> ... still no luck.</p>
  
  <p>Question is whether it is possible to move the fragments like this with a FragmentTransaction. If yes, what am I doing wrong (and bonus, is it possible to animate that?). If no, what would be the proper way to implement this?</p>
  
  <p>Note that I don't want to re-instantiate the fragments every time (each do some queries on the web that can take some time). It's possible to extract all the data back to the activity to recreate one, but I'd rather not do that if possible...</p>