[英]Chrome Custom Tab does not go back to app
I have a WebView that loads a HTML with links inside.我有一个 WebView,它加载一个带有链接的 HTML。 Those links are opened using Chrome Custom Tabs.
这些链接是使用 Chrome 自定义标签打开的。
Strange scenario:奇怪的场景:
[updated] The launch mode of my activity, set in the AndroidManifest, is singleInstance. [更新]我在 AndroidManifest 中设置的 Activity 的启动模式是 singleInstance。
The problem is that my activity had the launch mode "singleInstance".问题是我的活动具有“singleInstance”启动模式。 Changing to "singleTask" or not having a launchMode set in the AndroidManifest solves the problem.
更改为“singleTask”或未在 AndroidManifest 中设置 launchMode 可以解决该问题。
Don't know why is that.不知道这是为什么。 If you know why, I will gladly mark your explanation as the solution.
如果您知道原因,我很乐意将您的解释标记为解决方案。
如果您使用应用程序上下文而不是活动上下文,也会发生这种情况。
add android:noHistory="true"
to manifest.xml
where you've defined activity.将
android:noHistory="true"
到您定义活动的manifest.xml
。 It is working perfectly它运行良好
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.