我将 ExpandableListView 与 SimpleCursorTreeAdapter 一起使用。在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;
}
关于Android ExpandableListView获取bindChildView内的组号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8872056/