title: How to close fragment correctly?
body: <p>Now I have a fragment to do something will last long time. In some case , the activity will call <code>onSaveInstanceState</code> when fragment is still running. After fragment do all the things , I want to close it. Here will throw an exception <code>Can not perform this action after onSaveInstanceState</code>.</p>
  
  <p>I know what it means, but I really need to close the fragment after something has been done. So if I use <code>commitAllowingStateLoss</code> to force fragment to close , after activity recreate, the <code>close state</code> won't be recreated, the UI will be broken.</p>
  
  <p>So how should I close the fragment correctly ?</p>