6

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

当用户回到我的应用程序/活动时,有什么方法可以关闭 chrome 自定义选项卡。

4

2 回答 2

13

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

于 2015-10-22T22:12:21.080 回答
1

正如@Jaspinder Kaur 提到的:你需要在你的旗帜上添加这个:

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

和:

如果您将应用程序设置为singleInstanceor singleTop,那么当您使用意图返回到它时,框架也会完成自定义选项卡活动。

于 2017-11-29T19:27:46.020 回答