Chrome“自定义标签"不会返回到应用 [英] Chrome Custom Tab does not go back to app
问题描述
我有一个WebView,它加载了内部带有链接的HTML.这些链接是使用Chrome自定义标签打开的.
I have a WebView that loads a HTML with links inside. Those links are opened using Chrome Custom Tabs.
奇怪的情况:
Strange scenario:
- 打开Chrome浏览器
- 打开应用
- 按任意链接(这将打开一个Chrome自定义标签)
- 按下自定义"标签上的后退"按钮或"x"按钮
- 而不是返回到应用程序,而是显示chrome浏览器.
[更新] 我在AndroidManifest中设置的活动的启动模式为singleInstance.
[updated]
The launch mode of my activity, set in the AndroidManifest, is singleInstance.
推荐答案
问题是我的活动具有启动模式"singleInstance".更改为"singleTask"或在AndroidManifest中未设置launchMode即可解决此问题.
The problem is that my activity had the launch mode "singleInstance". Changing to "singleTask" or not having a launchMode set in the AndroidManifest solves the problem.
不知道为什么.如果您知道原因,我们很乐意将您的解释标记为解决方案.
Don't know why is that. If you know why, I will gladly mark your explanation as the solution.
这篇关于Chrome“自定义标签"不会返回到应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!