android - ExpandableListView click handling -
two questions:
i want allow user long-click on child items if they're in first group of expandable list view. under other group, should not allowed. how can this?
i want user allowed long-click group items except first one.
i'm going handling both questions in expandablelistviews onitemlongclicklistener.
currently have:
@override public boolean onitemlongclick(adapterview<?> parent, view view, int position, long id) { if (bunchesexplistview.getpackedpositiontype(id)==expandablelistview.packed_position_type_group) { // long click on bunch bunchlongclickdialog bunchlongclickdialog = new bunchlongclickdialog(); bundle bundle = new bundle(); bundle.putint("group_position", position); bunchlongclickdialog.setarguments(bundle); bunchlongclickdialog.show(getfragmentmanager(), "bunch_long_click_dialog"); } return true; }
this tells if i'm clicking group, doesn't check group being first one, , nothing address first question.
autobot_101 helped me answer question post here.
essentially can use getpackedposition obtain groupposition , childposition before doing conditionals!
Comments
Post a Comment