美文网首页
ExpandableListView 点击事件

ExpandableListView 点击事件

作者: 墨韵 | 来源:发表于2016-08-24 11:17 被阅读273次

1.满足条件

如果使用ExpandableListView,需要子item响应一个事件,比如重新启动一个新的activity,需要满足下面的条件:

(1).修改Adapter返回值

覆写BaseExpandableListAdapter的isChildSelectable()的返回值为true;

(2).绑定监听器

调用ExpandableListView对象的setOnChildClickListener()方法,为其绑定监听器

相关文章

网友评论

      本文标题:ExpandableListView 点击事件

      本文链接:https://www.haomeiwen.com/subject/jlznsttx.html