2
我使用ExpandableListView和SimpleCursorTreeAdapter。有沒有可能在bindChildView方法內獲取當前小孩所屬的組號?Android ExpandableListView在bindChildView中獲取組編號
謝謝!
我使用ExpandableListView和SimpleCursorTreeAdapter。有沒有可能在bindChildView方法內獲取當前小孩所屬的組號?Android ExpandableListView在bindChildView中獲取組編號
謝謝!
我嘗試另一種方法來獲得組和兒童使用的位置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;
}