android - Pdf link problem
My application has one button. If you click that button then it will display the web pages based on the web service response using web开发者_Go百科view.
It works properly for general links. But for links that have .pdf
, a white screen gets displayed.
Is it possible to display the .pdf file using web view?
Would appreciate any help.
i used the following code
WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
mWebView.loadUrl("http://docs.google.com/gview?embedded=true&url="
+"http://www.kim-lai.com/images/Menu_100309.pdf");
It sounds like it could be trying to but there is no direct pdf rendering support in webview. Please look at the following question
android webview pdf
You may find the following question useful also
how to open a pdf file inside a webview for android?
EDIT
Android - Load PDF / PDF Viewer
Please also make sure you ask appropriate questions, prefrerably with code so that others can reproduce your problem and offer a solution. Do your own research!!! Stack overflow is not a magic site that does your work for you!!!
ADENDUM
You require internet permissions. Add this to your manifest.xml
SUPPLEMENTAL
I tried typing in the url into the browser and it tells me "Sorry, we are unable to retrieve the document for viewing or you don't have permission to view the document. "
mWebView.loadUrl("http://www.kimlai.com/images/Menu_100309.pdf");
Try like this, what do you see?
精彩评论