c0dehunter
c0dehunter

Reputation: 6150

ExpandableListView get group text

I have an ExpandableListView, I've made custom adapter and ExpandListGroup class which holds Name and Subitems.

Every Subitem also has an ImageButton and when clicked I would like to get the Group Name. I tried using OnGroupExpandListener but it doesn't work.

enter image description here

Upvotes: 0

Views: 2434

Answers (1)

Kumar Bibek
Kumar Bibek

Reputation: 9117

2 ways:

  1. The way the data structure is set for an Expandable List view, you should be able to get the group name by looking at the group ID/position.

  2. You could set the group name as tags to child views. So, you could do a getTag(), and get the group name.

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

Upvotes: 1

Related Questions