【发布时间】:2019-08-28 04:47:39
【问题描述】:
我在网站中使用谷歌论坛来填写详细信息,在 Android 应用程序的 Webview 中使用该网站。当我尝试在 Webview 中打开 Google 论坛短链接时显示错误:net::ERR_UNKNOWN_URL_SCHEME,错误代码:-10.
在 webview 屏幕中显示这一行:
intent://<a href="https://docs.google.com/forms/d/e/##########/viewform%3Fusp%3Dsend_form;end">forms.gle/************#Intent;package=com.google.android.gms;action=com.google.firebase.dynamiclinks.VIEW_DYNAMIC_LINK;scheme=https;S.browser_fallback_url=https://docs.google.com/forms/d/e/########/viewform%3Fusp%3Dsend_form;end</a>; could not be loaded because:<br><br>net::ERR_UNKNOWN_URL_SCHEME
完整的 URL 工作正常,浏览器中的 Url 工作正常。
使用的语言:Kotlin, 安卓设备:三星A 10, 安卓版本:9(饼图)
使用的代码:
webview.loadUrl("https://forms.gle/#########")
并使用了这些设置:
webview?.getSettings()?.javaScriptCanOpenWindowsAutomatically = true
webview?.getSettings()?.setAppCacheEnabled(true)
webview?.getSettings()?.setAppCachePath(this.cacheDir.path)
webview?.getSettings()?.cacheMode = WebSettings.LOAD_DEFAULT```
【问题讨论】:
标签: android kotlin webview google-forms