android webview javascript does not load sometimes -


i loading html data webview using loaddatawithbaseurl() method. html includes js file absolute path (file:///android_asset/myjs.js). if set base url "file:///android_asset/" or "fake://not_needed" in loaddatawithbaseurl method, javascript not loads. works of time , can see rendered html in webview. fails execute javascript included in html. have viewpager webview in each page. webviews being loaded @ same time.

try :

webview.getsettings().setjavascriptenabled(true); 

and before making call loadurl :

webview.clearcache(true); webview.clearhistory(); 

Comments

Popular posts from this blog

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -