long-click
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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