title: How to close the application
body: <p>I have seven activities in my application. I have exit button in my first activity. When I am first click on the Exit button then it runs ok...... but when i am on second,third......activities and comes direct to the first activity then the Exit Button took me in the previous activity.....</p>
  
  <pre><code>    Button Exit = (Button) findViewById(R.id.close);
      Exit.setOnClickListener(new View.OnClickListener() {
          public void onClick(View view) {
  
              finish();
              System.exit(1);
  
          }
  
      });
  </code></pre>