Hi all.
Do we have any way to change the alert dialog button in webview? At the moment the alert dialog button is white and it can't be seen as the background colour is white as well.
Tried changing the webview user agent and also tried to override onJsAlert, but it does not help. I tried to debug but it does not go into onJsAlert function when the alert dialog is shown.
mContentWebView.setWebChromeClient(new WebChromeClient() {
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
AlertDialog dialog = new AlertDialog.Builder(view.getContext(), R.style.CustomAlertDialogStyle).
setTitle("YourAlertTitle").
setMessage(message).
setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//do nothing
}
}).create();
dialog.show();
result.confirm();
return true;
}
Tried accessing the website on mobile web browser and the button colour is black. Just in Android app is white colour.
Any advice on changing the alert dialog button colour?