JavaScript alert not working in Android WebView
Check this link , and last comment , You have to use WebChromeClient
for your purpose.
As others indicated, setting the WebChromeClient is needed to get alert()
to work. It's sufficient to just set the default WebChromeClient():
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setWebChromeClient(new WebChromeClient());
Thanks for all the comments below. Including John Smith's who indicated that you needed to enable JavaScript.