title: Ability to have verification screen which returns to last activity on the stack when finish and finish whole app when back press
body: <p>I am struggling with the concept of creating the verification screen in my app (which is refreshing the state and require user to provide valid PIN)</p>
  <p>Here are two important navigation requirements for that screen:</p>
  <ul>
  <li>I want that verification screen to close when the PIN is valid and when finish return to the last opened screen on the stack</li>
  <li>When user tap the back press on that verification screen I want to close the whole app (so that there is nothing in the background). So the whole previous stack of screens are closed/finished</li>
  </ul>
  <p><strong>What I've tried:</strong>
  It seems that to be able to close the whole app when the activity finish (with all previous activities/screens) that last activity should be started with additional flag <code>android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK</code> set to the <code>Intent</code></p>
  <p>But how i can remain the whole previous stack when the verification screen passed with valid PIN (and the verification activity is finished by calling <code>FragmentActivity.finish()</code>)?</p>
  <p>Another concept is to use <code>finishAffinity()</code>, but how to handle the case, when the previous screens are belonging to some different affinity process in my app? I want to close all present affinity processes (when there are multiple)</p>