Reputation: 693
I'm using ExpandableListView with a SimpleCursorTreeAdapter. Is it possible to get the group number to which the current child belongs to inside the bindChildView method?
Thanks!
Upvotes: 2
Views: 1448
Reputation: 693
I tried another approach to obtain group and child position using getChildView:
@Override
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
ImageButton ib=null;
View v = super.getChildView(groupPosition, childPosition,isLastChild, convertView, parent);
ib=(ImageButton)v.findViewById(R.id.delete);
ib.setTag(R.id.TAG_GROUPPOS, groupPosition);
ib.setTag(R.id.TAG_CHILDPOS, childPosition);
return v;
}
Upvotes: 3