android - setBackgroundColor() in Webview is not working -


i have created webview transparent background.

browser = new webview(activityactivate.this); browser.setbackgroundcolor(0);  browser.getsettings().setjavascriptenabled(true); browser.addjavascriptinterface(new javascriptinterface(), "javainterface");                 browser.getsettings().setjavascriptcanopenwindowsautomatically(true); browser.getsettings().setsupportzoom(true);  browser.loaddatawithbaseurl("https://checkout.google.com", form, "text/html", "utf-8", null); llpaymentbuttons.addview(browser); 

here javainterface should change color of background when html form submitted , checkboxes pass test.

/**  * interface javascript communication  */ private class javascriptinterface {      //this in fact used javascript     @suppresswarnings("unused")     public boolean checkboxpass() {         if( acceptsconditions() && acceptslicense() && acceptsrefundpolicy() ) {             browser.setbackgroundcolor(color.white);             return true;         }         return false;     } } 

this not work however, , returned document still has transparent background. doing wrong, seems browser.setbackgroundcolor(color.white); nothing?

you can override webview background setbackgroundresource method,

try it,

wv.setbackgroundcolor(0); wv.setbackgroundresource(color.blue); wv.loadurl(url);  

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -