Android WebView with JavaScript enabled -
in webview
in app cannot run javascript
. tried many ways , searched many stackoverflow pages find answer. cannot show me simple alert message.
here's code :
webview webview = (webview) findviewbyid(r.id.wv_webviewac); webview.getsettings().setjavascriptenabled(true); webview.getsettings().setjavascriptcanopenwindowsautomatically(true); webview.loadurl(url);
eeverything fine in browser in webview
doesn't work.
this solve problem
mwebview = (webview) findviewbyid(r.id.activity_main_webview); websettings websettings = mwebview.getsettings(); websettings.setjavascriptenabled(true); mwebview.loadurl("https://syllabkerala.in"); mwebview.setwebviewclient(new webviewclient() { @override public void onpagefinished(webview view, string url) { //hide loading image findviewbyid(r.id.progressbar1).setvisibility(view.gone); //show webview findviewbyid(r.id.activity_main_webview).setvisibility(view.visible); } });
Comments
Post a Comment