Load url web view android - Java -


i have webview in app , got working this

webview = (webview) findviewbyid(r.id.mainwebview); webview.loadurl("https://www.google.com"); 

but if try load non mobile version of https://uniondining.sodexomyway.com/images/mar2015dutchcalendar_000_tcm1792-59025.pdf exits out of app.

how can load mobile version of site in app?

thanks

unfortunately, android not support viewing pdfs out of box in webview. luckily, google has nifty little tool allows perform task quite using google docs. embed our pdf in google doc page on-the-fly , load that.

you can use google docs viewer read pdf online: here's code:

webview webview = (webview) findviewbyid(r.id.webview); webview.getsettings().setjavascriptenabled(true);  string pdf = "http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf"; webview.loadurl("http://docs.google.com/gview?embedded=true&url=" + pdf); 

if use view url user not propted login there google account.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -