多くのアドバイスに従って、私はgoolge docsを使用してPDFをWebViewに表示しようとしています。
これが私のコードです:
@SuppressLint("SetJavaScriptEnabled")
public void setDocumentPath(final String path) {
WebView webView = (WebView) findViewById(R.id.webview);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setPluginsEnabled(true);
webView.loadUrl("https://docs.google.com/viewer?url=http://www.selab.isti.cnr.it/ws-mate/example.pdf");
}
PDFは、私がオンラインで見つけたほんの一例です。ブラウザでは動作しますが、Android エミュレータとデバイスでは「Web ページは利用できません」と表示されます。
どちらもAndroid 4.0を実行しています。
私が見逃している明らかなものはありますか?ありがとうございました。