ExpandableListView.getPackedPositionChild(id)
下面总是返回 0。组位置是正确的,但我无法获得正确的子位置。下面的代码有什么问题?
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
if (ExpandableListView.getPackedPositionType(id) == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
int groupPosition = ExpandableListView.getPackedPositionGroup(id);
int childPosition = ExpandableListView.getPackedPositionChild(id);
// do something
return true;
}
return false;
}