android - ExpandableListView click handling -


two questions:

  1. 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?

  2. 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

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -