I'm developing an app that requires certain level of security. I need to have a feature when you press the home button and later enter in the app again, the app requires a password to continue where you've been staying before pushing the home button.
I already tried to do this, but when you call a new activity, the password screen is showed and I only need it when the home button is pressed:
@Override
public void onStop(){
super.onStop();
if (!isFinishing()) {
Intent i = new Intent(this, Register.class);
startActivity(i);
}
}
The normal flow is this:
Main->2nd Activity
but if I use the code that I showed, this is the flow:
Main->2nd Activity->Password Activity
It also works for home button but no for normal flow.
I already tried this and it works perfectly, but I don't want to add a new permission.