title: clear stack without calling startActivity()
body: <p>I'm on a certain Activity &amp; I want to clear the all the previous stack if a certain condition is true.</p>
  
  <pre><code>if (condition_is_true) {
  // Clear stack
  }
  </code></pre>
  
  <p>I can't use:</p>
  
  <ol>
  <li><p>Because, I want to check the condition first</p>
  
  <pre><code>&lt;activity
      android:name=".CurrentActivity"
      android:noHistory="true" /&gt;
  </code></pre></li>
  <li><p>Because, I don't want to start a new activity</p>
  
  <pre><code>Intent nextIntent = new Intent(CurrentActivity.this,
                                 NextActivity.class);
  nextIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                    | Intent.FLAG_ACTIVITY_CLEAR_TASK);
  startActivity(nextIntent);
  </code></pre></li>
  </ol>