title: Cannot finish Activity
body: <p>In my app I have 5 activities excluding main activity Im using other 4 activites repeatedly in cycle manner.</p>
  
  <p>in my each activity (except main) onPause() method I have written Activityname.this.finish();</p>
  
  <p>when I'm ending cycle on 5 th activity and returning back to main activity...</p>
  
  <p>but my problem is when I'm ending main activity.. instead of closing app, it goes to 3 rd activity.</p>
  
  <p>I don't know where is a problem exactly. may be in 3rd activity im using db n not closing it explicitly. Is this a problem?</p>
  
  <pre><code>@Override
  protected void onPause() {
      // TODO Auto-generated method stub
      super.onPause();
      PlayerDetails.this.finish();
  }
  </code></pre>
  
  <p>this onPause() method I'm using</p>
  
  <pre><code>@Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
      // TODO Auto-generated method stub
      if (keyCode==KeyEvent.KEYCODE_BACK){
          AlertDialog.Builder alert = new AlertDialog.Builder(MainActivity.this);
          alert.setIcon(R.drawable.ic_launcher);
          alert.setTitle(R.string.app_name);
          alert.setMessage("Really Exit?");
          alert.setPositiveButton("Yes", new DialogInterface.OnClickListener(){
              @Override
              public void onClick(final DialogInterface dialog, final int which) {
                      MainActivity.this.finish();
                      dialog.dismiss();
                      }
          });
          alert.setNegativeButton("No", new DialogInterface.OnClickListener(){
              @Override
              public void onClick(final DialogInterface dialog, final int which) {
                      dialog.dismiss();
                      }
          });
          try{
          AlertDialog dialog = alert.create();
          dialog.show();
          }
          catch(Exception e){
              e.printStackTrace();
          }
      }
      return true;
  }
  </code></pre>
  
  <p>this is my mainActivity method to close the app</p>