Skip to content

Instantly share code, notes, and snippets.

@jezinka
Last active Apr 12, 2017
Embed
What would you like to do?
long-click
expandableListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
int itemType = ExpandableListView.getPackedPositionType(id);
if (itemType == ExpandableListView.PACKED_POSITION_TYPE_GROUP) {
long packedPos = ((ExpandableListView) parent).getExpandableListPosition(position);
int groupPosition = ExpandableListView.getPackedPositionGroup(packedPos);
Date date = dinnerAdapter.getGroup(groupPosition);
final AlertDialog.Builder builder = addNewDinnerBuilder(view, date);
builder.show();
return true;
}
return false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment