How should be the data for a SimpleExpandableListAdapter organized

后端 未结 3 1038
走了就别回头了
走了就别回头了 2021-01-18 08:36

I am trying to create a ExpandableListView with the SimpleExpandableListAdapter(I know I can extend a new adapter myself, but I want to try the sim

3条回答
  •  借酒劲吻你
    2021-01-18 09:19

    You will need two lists or arrays.

    Parent (Dev. Team and Data Process team)

    The parent list is regular one, you will have to add all the parents i.e. top level items.

    Childrean

    The main difference between parent and children list, is that children list is a list of lists.

    So for example if you need the children of the parent you will do something like this

    children.get(parentPosition)
    

    And if you need an specific child

    children.get(parentPosition).get(childPosition)
    

    Here you can find an example using BaseExpandableListAdapter

提交回复
热议问题