I have LoginActivity which is my MAIN as well as LAUNCHER Activity and I also have other activities such as CustomerAddActivity & CustomerListActivity.
Now Suppose I'm in CustomerAddActivity and I pressed Home button and app goes to background and when again app comes to foreground it must have to ask for LoginActivity first if valid credentials(simple credentials such as username and pin from sq-lite) then back to CustomerAddActivity with it's state.
When returning to your app you can
startActivityForResultto log-in the user and then go back to the previous state. In order to do it from anywhere you can define an abstractBaseActivitylike this andoverrideit from all your other classes: