cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject git commit: android: Fix StatusBar.initialize() not running on UI thread
Date Tue, 24 Jun 2014 16:18:29 GMT
Repository: cordova-plugin-statusbar
Updated Branches:
  refs/heads/master d2f8b0b0a -> 92a4eaeab


android: Fix StatusBar.initialize() not running on UI thread


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/commit/92a4eaea
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/tree/92a4eaea
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/diff/92a4eaea

Branch: refs/heads/master
Commit: 92a4eaeab5f1b025772abc513628389746e3da9d
Parents: d2f8b0b
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Tue Jun 24 12:18:07 2014 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Jun 24 12:18:07 2014 -0400

----------------------------------------------------------------------
 src/android/StatusBar.java | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/92a4eaea/src/android/StatusBar.java
----------------------------------------------------------------------
diff --git a/src/android/StatusBar.java b/src/android/StatusBar.java
index 17152ec..e4f748f 100644
--- a/src/android/StatusBar.java
+++ b/src/android/StatusBar.java
@@ -43,14 +43,19 @@ public class StatusBar extends CordovaPlugin {
      * @param webView The CordovaWebView Cordova is running in.
      */
     @Override
-    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
+    public void initialize(final CordovaInterface cordova, CordovaWebView webView) {
         Log.v(TAG, "StatusBar: initialization");
         super.initialize(cordova, webView);
 
-        // Clear flag FLAG_FORCE_NOT_FULLSCREEN which is set initially
-        // by the Cordova.
-        Window window = this.cordova.getActivity().getWindow();
-        window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
+        this.cordova.getActivity().runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                // Clear flag FLAG_FORCE_NOT_FULLSCREEN which is set initially
+                // by the Cordova.
+                Window window = cordova.getActivity().getWindow();
+                window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
+            }
+        });
     }
 
     /**


Mime
View raw message