Take a look at the life cycle of an activity . If I were going to do something like this, I would have every activity request be a pin, unless they were launched with the intention and an additional value with the current output.
Launch:
Intent intent = new Intent(getBaseContext(), NewActivity.class); intent.putExtra("PIN", storedPIN); startActivity(intent);
Start of activity:
@Override public void onResume() { super.onResume(); Bundle extras = getIntent().getExtras(); if (extras != null) { String value = extras.getString("PIN"); }
In accordance with this methodology, when an application is first launched, it requests output. After entering the contact, when the Main Activity launches other actions, it transfers the saved PIN code and will no longer request a conclusion.
You may also need to clear additional functions from the current activity when it starts another action.
source share