cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject git commit: CB-4586: Making loadUrl run on the UI thread for close dialog to stop the WebView error
Date Wed, 28 Aug 2013 21:19:59 GMT
Updated Branches:
  refs/heads/master be364c081 -> 8b52796a8


CB-4586: Making loadUrl run on the UI thread for close dialog to stop the WebView error


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/8b52796a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/8b52796a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/8b52796a

Branch: refs/heads/master
Commit: 8b52796a8959aa96ed986ef520e1f94df3650715
Parents: be364c0
Author: Joe Bowser <bowserj@apache.org>
Authored: Wed Aug 28 14:20:01 2013 -0700
Committer: Joe Bowser <bowserj@apache.org>
Committed: Wed Aug 28 14:20:01 2013 -0700

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


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


Mime
View raw message