WebView webView = (WebView)findViewById(R.id.documentView);
webView.invalidate();
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
webView.loadData(path.toString(),"application/pdf", "UTF-8"
);
请帮帮我。
答案 0 :(得分:0)
试试这个
String localPath = path.toString();
localPath = localPath.replace(" ", "%20").trim();
并像这样使用
WebView webView = (WebView)findViewById(R.id.documentView);
webView.invalidate();
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
webView.loadData("file:///"+localPath,"application/pdf", "UTF-8");