diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java index a4f6b8b..0dd1094 100644 --- a/src/android/InAppBrowser.java +++ b/src/android/InAppBrowser.java @@ -313,7 +313,17 @@ public class InAppBrowser extends CordovaPlugin { */ private void closeDialog() { try { - this.inAppWebView.loadUrl("about:blank"); + final WebView childView = this.inAppWebView; + Runnable runnable = new Runnable() { + + @Override + public void run() { + childView.loadUrl("about:blank"); + } + + }; + + this.cordova.getActivity().runOnUiThread(runnable); JSONObject obj = new JSONObject(); obj.put("type", EXIT_EVENT);