As @Jaspinder Kaur said: you need to add this to your flag:
mCustomTabsIntent = new CustomTabsIntent.Builder().build(); mCustomTabsIntent.intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY)
and
If you set your application to singleInstance or singleTop , then when you return to it with the intention, the infrastructure will also exit with a custom tab.
source share