You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/06/15 07:17:41 UTC

[7/8] incubator-weex git commit: modify mCurrentGround boolean

modify mCurrentGround  boolean


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ff9c4a8e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ff9c4a8e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ff9c4a8e

Branch: refs/heads/0.14-dev
Commit: ff9c4a8ee5b02b055d03fb713ab97615e60e440a
Parents: 7ffe22c
Author: hao.haoh <ha...@taobao.com>
Authored: Thu Jun 15 14:57:04 2017 +0800
Committer: hao.haoh <ha...@taobao.com>
Committed: Thu Jun 15 14:57:04 2017 +0800

----------------------------------------------------------------------
 .../sdk/src/main/java/com/taobao/weex/WXSDKInstance.java | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ff9c4a8e/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java b/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
index b101b30..5533843 100644
--- a/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
+++ b/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
@@ -81,7 +81,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicBoolean;
 
 import static com.taobao.weex.http.WXHttpUtil.KEY_USER_AGENT;
 
@@ -142,7 +141,7 @@ public class WXSDKInstance implements IWXActivityStateListener,DomContext, View.
 
   private LayoutFinishListener mLayoutFinishListener;
 
-  private AtomicBoolean mCurrentGround = new AtomicBoolean(false);
+  private boolean mCurrentGround = false;
 
   /**
    * If anchor is created manually(etc. define a layout xml resource ),
@@ -764,13 +763,13 @@ public class WXSDKInstance implements IWXActivityStateListener,DomContext, View.
     }
 
     WXLogUtils.i("Application onActivityPause()");
-    if (!mCurrentGround.get()) {
+    if (!mCurrentGround) {
       WXLogUtils.i("Application to be in the backround");
       Intent intent = new Intent(WXGlobalEventReceiver.EVENT_ACTION);
       intent.putExtra(WXGlobalEventReceiver.EVENT_NAME, Constants.Event.PAUSE_EVENT);
       intent.putExtra(WXGlobalEventReceiver.EVENT_WX_INSTANCEID, getInstanceId());
       mContext.sendBroadcast(intent);
-      this.mCurrentGround.set(true);
+      this.mCurrentGround = true;
     }
   }
 
@@ -787,13 +786,13 @@ public class WXSDKInstance implements IWXActivityStateListener,DomContext, View.
       WXLogUtils.w("Warning :Component tree has not build completely, onActivityResume can not be call!");
     }
 
-    if (mCurrentGround.get()) {
+    if (mCurrentGround) {
       WXLogUtils.i("Application  to be in the foreground");
       Intent intent = new Intent(WXGlobalEventReceiver.EVENT_ACTION);
       intent.putExtra(WXGlobalEventReceiver.EVENT_NAME, Constants.Event.RESUME_EVENT);
       intent.putExtra(WXGlobalEventReceiver.EVENT_WX_INSTANCEID, getInstanceId());
       mContext.sendBroadcast(intent);
-      mCurrentGround.set(false);
+      mCurrentGround = false;
     }
 
     onViewAppear();