Skip to content

Instantly share code, notes, and snippets.

Last active April 12, 2017 10:47
What would you like to do?
expandableListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
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);;
return true;
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment