mobile menu
Site icon
ZIDSWORLD

The Tech Galaxy

Live support

How to Enable JavaScript in Webview Android 

Monday, November 20, 2023, 4 AM

By default, javascript is disabled in android webview. use this piece of code to enable it

WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);

The boolean "true" sets the JavaScript enabled, to disable JavaScript, use boolean "false"

Comments

No comments found.