title: Android: Multiple Activities and OnDestroy Question
body: <p>I have a few dozen activities: 1-Main, 1-Animation, 10-Other's and it's sub-sets of more activities (couple of dozen).</p>
  
  <p>From the Main, you can go to any of the <em>Others</em> via buttons.  </p>
  
  <p>The <em>Others</em> call <em>sub-set</em> activities and they call the Animation activity.  </p>
  
  <p>Each of the activities, including sub-sets and Animation, has a button to return to the Main activity.</p>
  
  <p>All buttons take user to correct activity.</p>
  
  <p><strong>The issue</strong>: From the Main activity, I want to quit via using the device's Back key. But, what happens is that it steps backward through all the previous activities.  </p>
  
  <p>The "return to main" buttons (in each activity) has <em>finish</em> and <em>onDestroy</em> in it. So, I'm not sure why those screen/activities aren't destroyed...?</p>
  
  <p>Any comments/suggestions/clarifications is appreciated - thanks</p>
  
  <p>[adding code snippet]  </p>
  
  <p>Note: I moved/added/deleted the finish, onDestroy, onStop... tried many ways so what shows in the snippet is only one way I tried...</p>
  
  <pre><code>    //  ---------------------------------------------------------
  mainMenu.setOnClickListener(new View.OnClickListener() {
      public void onClick(View v) {
          // do something
          Intent Maincode = new Intent();
            Maincode.setClassName(
                                "com.bt.test",
                                "com.bt.test.Maincode");
          //  startActivity(Maincode); // go to maincode  
            finish();
            onStop();
          onDestroy();
          startActivity(Maincode); // go to maincode  
      }
  }); // end -----------------------------------------------
  </code></pre>