title: Calling finishAffinity() does not destroy android app or activity. Activity's data still persists even when app is restarted
body: <p>This is a huge Android Programming issue/bug.</p>
  
  <p>Calling <strong>finishAffinity()</strong> does not shut down my application.<br>
  This is evidenced from the fact that:  <br/><br/>
  1. The Android Studio Debugger still says 'Application is running' even after the app disappears from the screen and I'm back to the phones home screen.<br>
  <br/>
  2. When '<em>restarting</em>' the application the values of data members of the inital Activity remain the same as they were before the application supposedly '<em>shutdown</em>'.<br>
  <br/>
  3. If I call <strong>System.exit(0)</strong> directly after <strong>finishAffinity()</strong> then the shutdown works properly and data members are reset to their initial default values.<br>
  <br/><br/>
  There are even bigger implications to this problem!   When I call <strong>finish()</strong> within <strong>ActivityA</strong> after starting another <strong>ActivityB</strong>, if I ever go back to <strong>ActivityA</strong> then the data members have not been reset to default are still the old values.
  <br/><br/>
  This is ALL <em>confusing</em> to me since I've come from C++ where when a class is destroyed then it is <strong>ACTUALLY</strong> destroyed and all memory associated with it is completely released.
  <br/><br/>
  Getting an activity to completely delete itself when switching to a new activity or trying to exit the application seems IMPOSSIBLE.</p>
  
  <pre><code>public class Startup extends AppCompatActivity
  {
      private static int iStarted = 0;
  
      ............
  
      @Override
      protected void onActivityResult(int request, int result, Intent data)
      {
          super.onActivityResult(request, result, data);
  
          if (request == RESULT_EULA_RETURNED)
          {
              // shutdown
              finishAffinity(); // iStarted remains = 1
              return;
          }
      }
  
      ..........
  
      @Override
      protected void onResume()
      {
          super.onResume();
  
          // perform startup
          // even when restarted this remains  = 1
          if (iStarted == 0)
          {
              iStarted = 1; // this will stay = 1 until the application is manually killed via the CLOSE ALL method or via the debugger
          }
      }
  }
  </code></pre>