I have created a personal contact book, with around 10 activity as per the business requirements for groups, contacts, editing, viewing, deleting-multiple, etc.
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.
Also, please note if another activity of the same contact-book application, login screen should not be shown.
I tried using onResume, onStart, onPause and onStop 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.
Please suggest, thanks !!!
Finally, I found it myself.
I managed writing a base class over all activities where setting and getting variable to and from Intent is done respectively.
So if application moves to background and comes to foreground later, the intent variable is not found, where i shown the login screen, rather entering to the application.
Thanks, Everyone who suggested approaches, let me know if gone in wrong way or wrong approach anywhere. Thanks to @midoalageb too..!
Thanks