title: Android Fragments: Lifecycle method *always* called when fragment is displayed?
body: <p>I need to execute some code whenever a fragment is displayed to the user.</p>
  
  <p>Looking through the API the closest hook method I could see for this is onResume. However, from debugging through my code it seems that onResume is <strong>not</strong> called when the user selects the back-button to return to a previously displayed fragment.</p>
  
  <p>Just to clarify the behaviour I am seeing:</p>
  
  <p>I have a 'parent' activity which configures tabs in an ActionBar... and 2 fragments F1 and F2.</p>
  
  <p>The user selects a tab and F1 is loaded into the activity. On a button press, the user can navigate to F2. This is not a separate tab... F2 is swapped into the layout.</p>
  
  <p>Adding log statements, I can see that when the user selects the back-button on F2, the following happens....</p>
  
  <p>1) onPause() is called on F2.
  2) F1 is loaded into the activity... but onResume() on F1 is <strong>not called</strong></p>
  
  <p>There are no errors in the logs at this time.</p>
  
  <p>Any ideas what I'm doing wrong here?</p>
  
  <p>Thanks in advance,</p>
  
  <p>Neil.</p>