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/03/14 08:15:50 UTC

[2/8] incubator-weex git commit: * [android] fix crash of RuntimeException

* [android] fix crash of RuntimeException


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

Branch: refs/heads/0.12-dev
Commit: f7977e35bfd6cd1fd8c93bdd495903a663181c8f
Parents: ae7b081
Author: zshshr <zh...@gmail.com>
Authored: Tue Mar 14 11:48:06 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Tue Mar 14 11:48:06 2017 +0800

----------------------------------------------------------------------
 .../main/java/com/taobao/weex/ui/component/WXComponent.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f7977e35/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
index 5e7adc8..ffd32f6 100755
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
@@ -145,6 +145,7 @@ import android.text.TextUtils;
 import android.view.Menu;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.AdapterView;
 import android.widget.FrameLayout;
 
 import com.alibaba.fastjson.JSONArray;
@@ -1069,7 +1070,11 @@ public abstract class  WXComponent<T extends View> implements IWXObject, IWXActi
     }
     if(mHost != null) {
       mHost.setOnFocusChangeListener(null);
-      mHost.setOnClickListener(null);
+      if(mHost instanceof AdapterView){
+        ((AdapterView)mHost).setOnItemClickListener(null);
+      }else {
+        mHost.setOnClickListener(null);
+      }
     }
   }