Android 通过webview阅读本地pdf

Android 通过webview阅读本地pdf,android,Android,我正在做一个应用程序,通过webview从sdcard读取pdf。我使用了以下代码 webview = (WebView) findViewById(R.id.webview); webview.getSettings().setJavaScriptEnabled(true); webview.setWebViewClient(new HelloWebViewClient()); File file = new File(Environment.getExternalS

我正在做一个应用程序,通过webview从sdcard读取pdf。我使用了以下代码

 webview = (WebView) findViewById(R.id.webview);
    webview.getSettings().setJavaScriptEnabled(true);
    webview.setWebViewClient(new HelloWebViewClient());
    File file = new File(Environment.getExternalStorageDirectory()
            + "/MotoronAug.pdf");
    Uri uri = Uri.fromFile(file);
    webview.loadUrl(uri.toString());
但我有一张空白页。但是当我给出一个网址时

webview.loadUrl("http://docs.google.com/viewer?url=http%3A%2F%2Fresearch.google.com%2Farchive%2Fbigtable-osdi06.pdf");

我可以从webview中阅读,我的代码中有什么问题?…我的SD卡中有MotoronAug.pdf文件。帮助我在线或本地的朋友都不会被webview呈现。

这回答了你的问题:那么…我不能在webview中离线打开pdf,对吗???IPhone中是否有类似quartzcore的android框架支持pdf阅读了解此quartzcore是什么,但如果您必须检测pdf支持,请检查以下内容: