how to see the alerts of my page in an android webview

1

Good morning, I'm showing my website in webview on android everything works fine except the page alerts that I charge in webview , for example:

alert("registro ingresado!");

but the webview does not show it. thanks.

    
asked by juan perez 15.01.2018 в 17:38
source

1 answer

1

A JavaScript alert

    alert("Stackoverflow.com is cool!");

that is from a web page that we load inside a WebView can not show the default message, you would have the option to enable WebChromeClient() and obviously enable the execution of Javascript:

WebSettings settings = webview.getSettings();
settings.setJavaScriptEnabled(true);
webView.setWebChromeClient(new WebChromeClient());

    
answered by 15.01.2018 в 19:02