WebChromeClient in device android not work -


i have code loading webview, uses properties of google chrome.

the problem emulator webview loads url containing html5 , works perfect on android device using properties of default browser , html5 not work url.

how can webview in android device use properties of google chrome browser , not default browser?

any help?

thank you

public view oncreateview(layoutinflater inflater,              viewgroup container, bundle savedinstancestate) {            // capturo las variables que dejo en memoria, nombre y email          sharedpreferences sp1 = preferencemanager.getdefaultsharedpreferences(getactivity().getapplicationcontext());         emailadd = sp1.getstring("emailaddress", "");         name = sp1.getstring("name", "");          //-----------------------------------------------           view x = inflater.inflate(r.layout.patrocinadores, container, false);          string url = "http://xxxx.co/xxxx/xxxx.php?email="+ emailadd + "";           mwebview = (webview) x.findviewbyid(r.id.webview1);           // para colocar un loading          pd = progressdialog.show(getactivity(), "", "loading...",true);          //--------------------------          if(mwebview != null){              mwebview.getsettings().setjavascriptenabled(true);             mwebview.getsettings().setcachemode(websettings.load_no_cache);             mwebview.getsettings().setappcacheenabled(false);              mwebview.getsettings().setallowfileaccess(true);             mwebview.getsettings().setallowcontentaccess(true);                mwebview.loadurl(url);             mwebview.setwebchromeclient(new webchromeclient());              mwebview.setwebviewclient(new webviewclient() {                    // coloca un loading mientras se carga el webview y se quita cuando se carga la pagina                   public void onpagefinished(webview view, string url) {                     if(pd.isshowing()&&pd!=null)                     {                         pd.dismiss();                     }                 }                  //-----------------------------------------------                   public boolean shouldoverrideurlloading(webview view, string url) {                     view.loadurl(url);                     return true;                 }             });         }          return x;     } 

i'm not sure understand you're referring to, html5 supported , should work within application if you've account items.

firstly, webchromeclient() not refer google chrome browser, original chrome terminology representing ui elements surrounding web page (ie, buttons, scroll bars, etc.). in sense, can override default behaviors javascript popup windows/notifications, titles, , other window features implementing own webchromeclient() have done webviewclient().

you can see other definition here: https://developer.mozilla.org/en-us/docs/glossary/chrome

additionally, if referring scaling , layout, direct webview overview, pixel-perfect ui. instance, setting view port , overview mode:

mwebview.getsettings().setusewideviewport(true) mwebview.getsettings().setloadwithoverviewmode(true) 

edit:

progress bar isn't working expected. try calling mwebview.loadurl(url) after have set clients.

mwebview.setwebchromeclient(new webchromeclient()); mwebview.setwebviewclient(new webviewclient(){...}); mwebview.loadurl(url); 

and override onpagestarted() within webviewclient():

@override public void onpagestarted (webview view, string url, bitmap favicon) {     pd.show(); } 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -