Remove Activities from Stack <p>In <code>Main</code>, there are buttons to start <code>A</code> and <code>X</code></p> <pre><code> /--&gt; A --&gt; B / Main \ \--&gt; X </code></pre> <p>There is a button in <code>B</code> to take it from <code>B --&gt; X</code>. If that happens, <code>A</code> and <code>B</code> should be removed from the activity stack, so that pressing <code>back</code> in <code>X</code> returns to <code>Main</code></p>