问题
I am beginner to android I need some Help about List and Extended List in one Drawer I know that this question is posted here several Time but I am unable to understand that Actually I want to make a list like:
Please Help me Step by Step thak you!...
回答1:
It's native behavior of ExpandableListView
so if any Item doesn't have children, implicitly won't be expanded but you need to set OnClickListener
for both groups (Items) and children (Options):
public boolean onChildClick(ExpandableListView parent, View row,
int groupPosition, int childPosition, long id) {
// callback method after click for Options
return false;
}
public boolean onGroupClick(ExpandableListView parent, View row,
int groupPosition, long id) {
/** if you are using BaseAdapter subclass implementation **/
adapter.getGroup(groupPosition)).getChildren() == null) {
// item doesn't have children
return true;
}
else {
// has children
return false;
}
来源:https://stackoverflow.com/questions/32710875/list-and-expandable-list-in-single-drawer