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
startActivityForResult
to log-in the user and then go back to the previous state. In order to do it from anywhere you can define an abstractBaseActivity
like this andoverride
it from all your other classes: