title: Got exception: fragment already active
body: <p>I have a <strong>fragment</strong>;</p>
  
  <pre><code>MyFragment myFrag = new MyFragment();
  </code></pre>
  
  <p>I put <strong>bundle data</strong> to this fragment:</p>
  
  <pre><code>Bundle bundle = new Bundle(); 
  bundle.putString("TEST", "test");
  myFrag.setArguments(bundle);
  </code></pre>
  
  <p>Then, I <strong>replace</strong> old fragment with this one and <strong>put on backstack</strong>:</p>
  
  <pre><code>//replace old fragment
  fragmentTransaction.replace(R.id.fragment_placeholder, myFrag, "MyTag");
  //put on backstack
  fragmentTransaction.addToBackStack(null);
  //commit &amp; get transaction ID
  int transId = fragmentTransaction.commit();
  </code></pre>
  
  <p>Later, I <strong>pop backstack</strong> with the above transaction ID(<code>transId</code>):</p>
  
  <pre><code>//pop the transaction from backstack
  fragmentManager.popBackStack(transId,FragmentManager.POP_BACK_STACK_INCLUSIVE); 
  </code></pre>
  
  <p>Later, I set <strong>bundle data</strong> as argument again to my fragment(<code>myFrag</code>):</p>
  
  <pre><code>//Got Java.lang.IllegalStateException: fragment already active
  myFrag.setArguments(bundle);
  </code></pre>
  
  <p>As you see, my above code got exception <code>Java.lang.IllegalStateException: fragment already active</code> . <strong>I don't understand why</strong> <code>myFrag</code> <strong>is still active though I have popped the transaction of it from backstack.</strong>, anyhow, since I got the exception I thought I have no choice but de-active the fragment, So, I did:</p>
  
  <pre><code>Fragment activeFragment = fragMgr.findFragmentByTag("MyTag");
  fragmentTransaction.remove(activeFragment);
  </code></pre>
  
  <p>I am not sure if my above code really can <strong>de-active</strong> the fragment, since I didn't find how to de-active an fragment. :(</p>
  
  <p>After that, when I try to set bundle data to my fragment <code>myFrag</code> again, I still got the same error: </p>
  
  <pre><code>Java.lang.IllegalStateException: fragment already active
  </code></pre>
  
  <p>Seems even I removed the fragment, it is still active...<strong>Why? How to de-active a fragment?</strong></p>