Close Custom Chrome Tab

In my use case, I have a page that deeply binds to my application. When I open this page on the Chrome tab, I can return to my application by clicking on the deep link, but the problem is that when I click the back button, the Chrome tab is still visible.

Is there a way to close the chrome user tab when the user returns to my app / activity.

+5
source share
2 answers

Setting the flag under the flag when opening the user chrome tab seems to fix the problem for me http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NO_HISTORY

+8
source

As @Jaspinder Kaur said: you need to add this to your flag:

mCustomTabsIntent = new CustomTabsIntent.Builder().build(); mCustomTabsIntent.intent.setFlags(Intent.FLAG_ACTIVITY_NO_HI‌​STORY) 

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.

0
source

Source: https://habr.com/ru/post/1234052/


All Articles