简体   繁体   中英

list and expandable list in single drawer

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

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 **/

       if(adapter.getGroup(groupPosition).getChildren() == null) {
          // item doesn't have children
           return true;
       }
       else {
          // has children
           return false;
       }
    }

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