title: Android remove multiple instances of same activity except the first
body: <p>I saw many threads similar to this. But my scenario is different. This is my <code>Activity</code> flow</p>
  
  <pre><code>Activity A -&gt; Activity A (optional)('n' times) -&gt; Activity B -&gt; Activity C
  </code></pre>
  
  <p>When I click a button in <code>Activity</code> C, I have to go back to First Activity A closing all others on top of it and perform a task there. When I click back button this flow should not be disturbed. I cannot use any <strong>android:launchmode</strong> except <strong>standard</strong> for my scenario. How can I achieve this?</p>