How should be the data for a SimpleExpandableListAdapter organized

后端 未结 3 1039
走了就别回头了
走了就别回头了 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:31

    There are literally so many examples for your requirement!

    Anyway, you might want to look into this blog, if you already haven't.

    http://www.coderzheaven.com/2011/04/10/expandable-listview-in-android-using-simpleexpandablelistadapter-a-simple-example/

    "does it mean that I have to create two layout for the group and the child view?"

    OF course, yes! , I mean you can choose to not create layouts, but then again it's your choice and this has very less to do with ExpandableList

    The GroupList ideally would contain a list of Teams line List = {"Development Team", "Data Process Team"} (This will predominantly used for display purpose only like calculating the height of the list etc.)

    The ChildList ideally would contain a list of lists (Hashmap of Lists rather)

    Hashmap> =

    Development Team: List = {"John", "Bill"} Data Process Team: List = {"John", "Bill"}

提交回复
热议问题