title: Finish all activities except one
body: <p>When i use this method, i go back to the login page, but I can still click the return button and it returns me to the previous activity. why doesn't it close other activities?</p>
  
  <pre><code>public void restartApplication() {
          Intent i = getBaseContext().getPackageManager().getLaunchIntentForPackage(getBaseContext().getPackageName());
          i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
          startActivity(i);   
      }
  </code></pre>
  
  <p>Is there a way to finish all activities except the login activity? or restart the whole app?</p>