gpt4 book ai didi

android:当我显示来自 dropbox 链接的 pdf 文件时,webview 显示空白屏幕

转载 作者:太空狗 更新时间:2023-10-29 14:19:22 25 4
gpt4 key购买 nike

这是我的代码,其中显示来自共享链接的 pdf 文件。请告诉我为什么它显示黑屏

protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_wbview);
mWebView=(WebView) findViewById(R.id.web_view);

String weblink="https://dl.dropboxusercontent.com/u/107860028/Publishing%20an%20Application%20on%20Google%20Play.pdf";
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl(weblink);
}

最佳答案

WebView打不开pdf View Pdf需要用google doc或者用AdobeReadr Pdf

      protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_wbview);
mWebView=(WebView) findViewById(R.id.web_view);

String weblink="https://dl.dropboxusercontent.com/u/107860028/Publishing%20an%20Application%20on%20Google%20Play.pdf";

mWebView.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("http://docs.google.com/gview?embedded=true&url=+weblink");
}

关于android:当我显示来自 dropbox 链接的 pdf 文件时,webview 显示空白屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18273530/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com