title: Catch returning of application from background in android
body: <p>I have created a personal contact book, with around 10 activity as per the business requirements for groups, contacts, editing, viewing, deleting-multiple, etc.</p>
  
  <p>If application is moved to background by home-button or another application, I need to catch the event when application returns from background to show the login screen, everytime. </p>
  
  <p>Also, please note if another activity of the same contact-book application, login screen should not be shown.</p>
  
  <p>I tried using <code>onResume</code>, <code>onStart</code>, <code>onPause</code> and <code>onStop</code> events of each activity by overriding the functionality in various activites for login, but this doesn't satisfies as if the application is in foreground and just an activity is changed, then also these are also called.</p>
  
  <p>Please suggest, thanks !!!</p>