Activity with Flag FLAG_ACTIVITY_CLEAR_TOP (android)
<p>I have stack of activities launched after one another.<br>
but in one of the activity I need to launch that particular activity with flag <code>FLAG_ACTIVITY_CLEAR_TOP</code>.  </p>

<p>So that it will finish all the previous activities and start.  </p>

<p>Problem I am facing that i don't want to finish one of the activity from the stack it should be presence on back of the newly launched activity.</p>

<p>Suppose I have activities <code>[A] [B] [C] [D]</code><br>
I am starting <code>[D]</code> activity with flag <code>FLAG_ACTIVITY_CLEAR_TOP</code> after starting activity <code>[D]</code> it will destroy all the activities, I want activity <code>[B]</code> to be kept running on the back and when we press back key on <code>[D]</code> it should display activity <code>[B]</code>.</p>

<p>How to do this?  </p>

<p>Thanks,<br>
PP.</p>
