jquery mobile - Android webview after onJsAlert not responding taps -
i have override webchromeclient's onjsalert behavior like:
webchromeclient wvcc = new webchromeclient() { @override public boolean onjsalert(webview view, string url, string message, final jsresult result) { //... return true; } }
my application handle js alerts , suppressed original alert. however, after alert event, can no long click buttons(in list-items of listview) on web page in webview. using jquery mobile build web.
is there else should aware of?
i faced same problem. wanted generate custom android dialog instead of alert, final solution:
mywebview.setwebchromeclient(new webchromeclient() { @override public boolean onjsalert(webview view, final string url, string message, jsresult result) { alertdialog.builder builder = new alertdialog.builder( mainactivity.this); builder.setmessage(message) .setneutralbutton("ok", new onclicklistener() { @override public void onclick(dialoginterface arg0, int arg1) { arg0.dismiss(); } }).show(); result.cancel(); return true; } });
the key result.cancel();
, return true;
, tested in several combinations, , 1 did not fired default js alert , didn't caused touch problem combination
Comments
Post a Comment