Get group clicked in OnGroupClickListener

前端 未结 1 1812
予麋鹿
予麋鹿 2021-01-28 23:03

How can I retrieve the group clicked in a OnGroupClickListener of a ExpandableListView.

I have tried parent.getItemAtPosition(groupPosition) and it return groups and chi

相关标签:
1条回答
  • 2021-01-28 23:18

    Try this:

    new OnGroupClickListener() {
    
        @Override
        public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
    
            Object object = parent.getExpandableListAdapter().getGroup(groupPosition);
    
            ....
            ....
    
            return true;
        }
    }
    

    This should work.

    0 讨论(0)
提交回复
热议问题