title: Detect when fragment becomes visible
body: <p><strong>Why not a duplicate:</strong> Suggested post only works for a viewpager, or when onResume is called. </p>
  
  <p>I have a listfragment and a detailfragment. The detail fragment is opened when a list item is clicked. I accomplish this by hiding the listfragment and I showing the detailfragment. When the user goes back, he returns to the listfragment.</p>
  
  <p>How can I detect when the user gets back to my fragment, or when my fragment is visible?</p>
  
  <p>Please note that I would like to keep using .hide() and show() and that I am looking for a listener or a onVisible to check <em>when</em> the fragment <em>becomes</em> visible, and not a method to check <em>if</em> it is visible.</p>