我不能(有900頁)一個大的PDF文件加載到我的 的WebView在我的Android應用程序,我嘗試此代碼,並在任何 其他PDF運作良好,但是當我嘗試打開一個大的顯示屏時:無預覽 可用。如何在Android中大的PDF文件加載到我的WebView
wvReport.getSettings().setJavaScriptEnabled(true);
wvReport.getSettings().setAllowFileAccess(true);
wvReport.getSettings().setAllowContentAccess(true);
wvReport.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
// TODO Auto-generated method stub
super.onPageFinished(view, url);
Toast.makeText(ReportsViewActivity.this, "Oh no! " , Toast.LENGTH_SHORT).show();
}
});
wvReport.setWebChromeClient(new WebChromeClient() {
@Override
public void onProgressChanged(WebView view, int progress) {
if (progress == 100) {
progressBar.setVisibility(View.INVISIBLE);
progressBar.setProgress(0);
} else {
progressBar.setVisibility(View.VISIBLE);
progressBar.setProgress(progress);
}
}
@Override
public void onReceivedTitle(WebView view, String title) {
}
});
wvReport.loadUrl("http://docs.google.com/viewer?url="+url);