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