From 73ed40fe0753ac9870333784c216cdb821402989 Mon Sep 17 00:00:00 2001 From: sgrebnov Date: Thu, 28 Jan 2016 17:16:32 +0300 Subject: [PATCH] CB-6702 InAppBrowser hangs when opening more than one instance github close #144 --- src/android/InAppBrowser.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java index a3b4a0d..6612a66 100644 --- a/src/android/InAppBrowser.java +++ b/src/android/InAppBrowser.java @@ -377,6 +377,7 @@ public class InAppBrowser extends CordovaPlugin { public void onPageFinished(WebView view, String url) { if (dialog != null) { dialog.dismiss(); + dialog = null; } } }); @@ -520,6 +521,12 @@ public class InAppBrowser extends CordovaPlugin { @SuppressLint("NewApi") public void run() { + + // CB-6702 InAppBrowser hangs when opening more than one instance + if (dialog != null) { + dialog.dismiss(); + }; + // Let's create the main dialog dialog = new InAppBrowserDialog(cordova.getActivity(), android.R.style.Theme_NoTitleBar); dialog.getWindow().getAttributes().windowAnimations = android.R.style.Animation_Dialog;