关闭Chrome自定义标签

时间:2015-10-19 19:34:56

标签: chrome-custom-tabs

在我的用例中,我有一个深度链接回我的应用程序的页面。当我在Chrome自定义标签中打开此页面时,我可以通过点击深层链接返回我的应用,但问题是当我点击设备后退按钮时,Chrome标签仍然可见。

当用户返回我的应用/活动时,我是否可以关闭Chrome自定义标签。

2 个答案:

答案 0 :(得分:8)

在打开Chrome自定义标签时设置以下标志似乎可以解决我的问题 http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NO_HISTORY

答案 1 :(得分:0)

正如@Jaspinder Kaur所说:你需要在你的旗帜上加上这个:

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

如果您将应用设置为singleInstancesingleTop,那么当您使用意图返回时,框架也会完成自定义标签活动。

相关问题