Skip to content

Commit

Permalink
fix webview after onJsAlert not responding taps
Browse files Browse the repository at this point in the history
  • Loading branch information
wheam committed Jan 2, 2015
1 parent 4816d6a commit 647ebe4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Android/Example/src/com/fangjian/WebViewJavascriptBridge.java
Expand Up @@ -82,6 +82,10 @@ public boolean onConsoleMessage(ConsoleMessage cm) {

@Override
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
// if don't cancel the alert, webview after onJsAlert not responding taps
// you can check this :
// http://stackoverflow.com/questions/15892644/android-webview-after-onjsalert-not-responding-taps
result.cancel();
Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
return true;
}
Expand Down
Expand Up @@ -82,6 +82,10 @@ public boolean onConsoleMessage(ConsoleMessage cm) {

@Override
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
// if don't cancel the alert, webview after onJsAlert not responding taps
// you can check this :
// http://stackoverflow.com/questions/15892644/android-webview-after-onjsalert-not-responding-taps
result.cancel();
Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
return true;
}
Expand Down
Expand Up @@ -80,6 +80,10 @@ public boolean onConsoleMessage(ConsoleMessage cm) {

@Override
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
// if don't cancel the alert, webview after onJsAlert not responding taps
// you can check this :
// http://stackoverflow.com/questions/15892644/android-webview-after-onjsalert-not-responding-taps
result.cancel();
Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
return true;
}
Expand Down

0 comments on commit 647ebe4

Please sign in to comment.