CB-6702 InAppBrowser hangs when opening more than one instance

github close #144
This commit is contained in:
sgrebnov 2016-01-28 17:16:32 +03:00
parent 4d9e4884dd
commit 73ed40fe07

View File

@ -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;