简体   繁体   中英

Android, ExpandableListView.setOnChildClickListener() does not work with registerForContextMenu() for childs

I have an ExpandableListView that it works brilliant when I click on it's children but when I set registerForContextMenu() for inner View that creates in getChildView in Adapter, setOnChildClickListener doesn't work.

If I set registerForContextMenu(mExpandable) it will work even for Group but I need it only for Child .

isChildSelectable(int groupPosition, int childPosition) which in turn returns false default when we implement. Since it is false, we are unable to get respond OnChildClickListener.

Make the return value to true for isChildSelectable method.

For more info: Solutions for ExpandableListView

I hope it will help you in solving your problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM