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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -