CB-6702 InAppBrowser hangs when opening more than one instance

github close #144


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/73ed40fe
Tree: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/73ed40fe
Diff: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/73ed40fe

Branch: refs/heads/1.2.x
Commit: 73ed40fe0753ac9870333784c216cdb821402989
Parents: 4d9e488
Author: sgrebnov <v-seg...@microsoft.com>
Authored: Thu Jan 28 17:16:32 2016 +0300
Committer: sgrebnov <v-seg...@microsoft.com>
Committed: Mon Feb 1 14:00:52 2016 +0300

----------------------------------------------------------------------
 src/android/InAppBrowser.java | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/73ed40fe/src/android/InAppBrowser.java
----------------------------------------------------------------------
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;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org
For additional commands, e-mail: commits-h...@cordova.apache.org

Reply via email to