title: Check enter and leave Preferences
body: <p>I'm using a PreferenceFragment and some headers to manage my application settings like in this official tutorial: <a href="http://developer.android.com/guide/topics/ui/settings.html#Fragment" rel="nofollow">http://developer.android.com/guide/topics/ui/settings.html#Fragment</a></p>
  
  <p>You can call Preferences by the ActionBar in several Activities.</p>
  
  <p>Now I want to detect, if a user enters oder leaves the preferences. How can I do that?</p>
  
  <p>My approach is using the lifecycle methods like: onCreate, onResume, onPause ....</p>
  
  <p>But is there another solution like a listener or something else?</p>