title: Can one reuse a fragment after process has been killed?
body: <p>Scenario:</p>
  
  <ol>
  <li>An Android app has an <code>Activity</code> with a <code>Fragment</code>.</li>
  <li>The user sends the app to the background by pressing the home key.</li>
  <li>Two hours pass, the Android OS kills the process to free up resources.</li>
  <li>The user switches back to the app through the <a href="http://www.android.com/images/ics/tasks-sm.png" rel="nofollow noreferrer">Recent Apps List</a>.</li>
  </ol>
  
  <p>The <code>onCreate</code> method of the Activity will now find the existing Fragment by using <code>fragmentManager.findFragmentByTag()</code>* as <a href="https://stackoverflow.com/questions/7951730/viewpager-and-fragments-whats-the-right-way-to-store-fragments-state/9646622#9646622">best practice cites</a>. Yet, adding this old fragment to the activity will not make the fragment render. I'm unsure if I'm doing something wrong, or this is simply not a supported use case for reusing old fragments.</p>
  
  <p>Must I implement special handling of this scenario (i.e. <code>new</code> up the Fragment instead of reusing the old)? If so, what is the best practice of detecting that the process has been killed and relaunched in <code>onCreate</code>?</p>
  
  <p><strong>edit 1</strong>: *) I am testing this by using DDMS to kill the process. This might not emulate the OS' way terminating a process correctly, as for instance <code>onDestroy()</code> is not called. Does anoyone know if the old fragments are disposed from the FragmentManager when <code>onDestroy()</code> is invoked by the OS? If this is the case, this question is moot.</p>