I need reauthenticate user credentials every time onRestart is called (usually this means the user has locked&unlocked the screen or put it on background and then returned to it).
So I did that:
@Override
protected void onRestart() {
super.onRestart();
Intent intent = new Intent(this, LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(LoginActivity.REAUTHENTICATE);
startActivity(intent);
}
This works, the LoginActivity was shown, but when it finishes the onRestart of the first Activity is called again and the LoginActivity is opened again.
How can I handle that?
Well, I used this to solve it:
Well, this it no what I expected but works, I hope someone find a better solution. Cause onRestart keep getting called after onActivityResult.
Until got a good solution/suggestion from any one can try this .