title: Exclude Activity from recents and history
body: <p>Actually I have a direct issue with android custom tabs.
  But nevertheless I will generalize my question. Let's assume that I have <code>ActivityA</code> and <code>ActivityB</code>. <code>ActivityA</code> - is an external one, so that we launch it from an Intent :</p>
  
  <pre><code>Intent intent = customTabsIntent.intent;
          intent.setData(requestUri);
          intent.putExtra(CustomTabsIntent.EXTRA_TITLE_VISIBILITY_STATE, CustomTabsIntent.NO_TITLE);
          mContext.startActivity(intent);
  </code></pre>
  
  <p>From here we see that <code>ActivityA</code> - is actually a custom tab activity. When things get done I launch <code>ActivityB</code>. I want <code>ActivityA</code> dissaper from task history, I can achieve this by aplying flag <code>Intent.FLAG_ACTIVITY_NO_HISTORY</code>  to my intent. But this approach is causing problems, because when user switches to recents,or goes to other app - <code>ActivityA</code> disappears forever. Of course - that's how flag no history works. But I want a different flow, I want <code>ActivityA</code> disappear only when <code>ActivityB</code> was launched. Any ideas how to achieve this?</p>
  
  <p><strong>P.S. I need to finish <code>ActivityA</code>, which gets launched via intent, I don't have access to its code and I don't have the ability to call <code>finish()</code>.</strong></p>