title: What is the difference between `finishAffinity();` and `finish()` methods in Android?
body: <p>I've using some code for a sign in screen that forces the app to close if the user doesn't want to sign in. If the user chooses to not sign in/cancel, it calls the code to exit the app. I've successfully done this two ways (not at the same time) with:</p>
  
  <pre class="lang-java prettyprint-override"><code>finishAffinity();
   System.exit(0);
  </code></pre>
  
  <p><strong>and</strong></p>
  
  <pre class="lang-java prettyprint-override"><code>finish();
   System.exit(0);
  </code></pre>
  
  <p>Yet both lines of code seem to do the same thing... The app is closed to the user, yet remains in the background apps to be reopen if the user hits the 'overview' button they can select it to reopen. (Which just restarts the prompt to sign in.)</p>
  
  <p>Since I notice no functional difference, I'm wondering what is the difference between <code>finishAffinity()</code> and <code>finish()</code> methods? </p>
  
  <p><strong>Bonus Question:</strong> Also, is there a way to completely shut down the app, so it also doesn't appear in the overview button app list?</p>