ExpandableListView 长按事件中获取当前Item 对应position
@Override
public boolean onLongClick(View v) {
int npos = mExpandableListView.pointToPosition((int) v.getX(), (int) v.getY());
if (npos != AdapterView.INVALID_POSITION) {
long pos = mExpandableListView.getExpandableListPosition(npos);
int childPos = ExpandableListView.getPackedPositionChild(pos);
int groupPos = ExpandableListView.getPackedPositionGroup(pos);
if (childPos == AdapterView.INVALID_POSITION) {
// group long click
managerListImpl.onGroupLongTouch(mBelieversListAdapter.getGroup(groupPos));
} else {
// child long click
managerListImpl.onChildLongTouch(mBelieversListAdapter.getChild(groupPos, childPos));
}
}
return true;
}