You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ti...@apache.org on 2020/03/20 14:08:05 UTC

[cordova-plugin-inappbrowser] branch master updated: Android GH-470 InAppBrowser: java.lang.IllegalArgumentException (#616)

This is an automated email from the ASF dual-hosted git repository.

timbru31 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-inappbrowser.git


The following commit(s) were added to refs/heads/master by this push:
     new e658c8c  Android GH-470 InAppBrowser: java.lang.IllegalArgumentException (#616)
e658c8c is described below

commit e658c8c20112de9322c464151a0b6f138850b39e
Author: Slayterik <59...@users.noreply.github.com>
AuthorDate: Fri Mar 20 17:07:48 2020 +0300

    Android GH-470 InAppBrowser: java.lang.IllegalArgumentException (#616)
    
    Fix interacting with views when Activity destroyed
    Bug description https://stackoverflow.com/questions/22924825/view-not-attached-to-window-manager-crash
    
    Co-authored-by: Sarafanov Valeriy <sa...@firma-gamma.ru>
---
 src/android/InAppBrowser.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java
index 8414438..efec7ec 100644
--- a/src/android/InAppBrowser.java
+++ b/src/android/InAppBrowser.java
@@ -313,7 +313,7 @@ public class InAppBrowser extends CordovaPlugin {
             this.cordova.getActivity().runOnUiThread(new Runnable() {
                 @Override
                 public void run() {
-                    if (dialog != null) {
+                    if (dialog != null && !cordova.getActivity().isFinishing()) {
                         dialog.show();
                     }
                 }
@@ -326,7 +326,7 @@ public class InAppBrowser extends CordovaPlugin {
             this.cordova.getActivity().runOnUiThread(new Runnable() {
                 @Override
                 public void run() {
-                    if (dialog != null) {
+                    if (dialog != null && !cordova.getActivity().isFinishing()) {
                         dialog.hide();
                     }
                 }
@@ -537,7 +537,7 @@ public class InAppBrowser extends CordovaPlugin {
                 childView.setWebViewClient(new WebViewClient() {
                     // NB: wait for about:blank before dismissing
                     public void onPageFinished(WebView view, String url) {
-                        if (dialog != null) {
+                        if (dialog != null && !cordova.getActivity().isFinishing()) {
                             dialog.dismiss();
                             dialog = null;
                         }


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