如何显示Excel,Docs,pdf ..使用WebView Android中的cookie
我正在尝试通过通过cookie显示 excel file(在线),但只有一个空白的白页。
它适用于 txt 文件,因此也许通过cookie不是问题。
webView.webViewClient = WebViewClient()
webView.settings.setSupportZoom(true)
webView.settings.javaScriptEnabled = true
val cookieManager = CookieManager.getInstance()
cookieManager.setAcceptCookie(true)
cookieManager.setCookie(url,cookie)
cookieManager.setAcceptThirdPartyCookies(webView, true)
cookieManager.flush()
webView.loadUrl(url)
我还尝试了此( android Webview,显示PDF通过Google Viewer通过Cookie 提交文件),但无效。
我该如何解决问题?
I'm trying to show excel file(online) in a webview with passing cookies, but only get a blank white page.
It works fine for txt file, so maybe passing the cookie is not the problem.
webView.webViewClient = WebViewClient()
webView.settings.setSupportZoom(true)
webView.settings.javaScriptEnabled = true
val cookieManager = CookieManager.getInstance()
cookieManager.setAcceptCookie(true)
cookieManager.setCookie(url,cookie)
cookieManager.setAcceptThirdPartyCookies(webView, true)
cookieManager.flush()
webView.loadUrl(url)
I also tried this(Android WebView, show pdf file via Google Viewer with passing cookies) but it didn't work.
How can I solve the problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论