title: Intent.FLAG_ACTIVITY_CLEAR_TOP doesn't deletes the activity stack
body: <p>I am developing the application in which i want to close whole application on button click. I know in android we should not think about to close the application because android does that automatically from this <a href="https://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon?lq=1">Is quitting an application frowned upon?</a>. but yet i want to close my application.</p>
  
  <p>So what i am doing to close application is i am using <code>Intent.FLAG_ACTIVITY_CLEAR_TOP</code> flag to delete the activity stack.</p>
  
  <pre><code>Intent intent = new Intent(Activity3.this, FinishActivity.class);
  intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  startActivity(intent);
  finish();
  </code></pre>
  
  <p>And in onCreate of <code>FinishActivity.class</code> i am calling <code>this.finish()</code> but application is not get closed and previous activity gets reopened.</p>
  
  <p>FinishActivity.class</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      this.finish();
  }
  </code></pre>
  
  <p><strong>Update :</strong></p>
  
  <p>Here is the scenario</p>
  
  <pre><code>MainActivity-&gt;Activity2-&gt;Activity3-&gt;FinishActivity
  </code></pre>
  
  <p>Here <code>Activity2</code> is gets opened after finishing the activity.</p>
  
  <p>How do i achieve this? Any idea and suggestion will be appreciated.</p>
  
  <p>Thanks &amp; Regards</p>