ExpandableListView获取组文本

时间:2012-05-31 18:09:28

标签: android expandablelistview

我有一个ExpandableListView,我已经制作了自定义适配器和包含Name和Subitems的ExpandListGroup类。

每个Subitem也有一个ImageButton,点击后我想获得Group Name。我尝试使用OnGroupExpandListener但它不起作用。

enter image description here

1 个答案:

答案 0 :(得分:1)

2种方式:

  1. 为可扩展列表视图设置数据结构的方式,您应该能够通过查看组ID /位置来获取组名。

  2. 您可以将组名称设置为子视图的标签。因此,您可以执行getTag(),并获取组名。

  3. http://developer.android.com/reference/android/widget/ExpandableListView.OnChildClickListener.html