

ListDataChild.put(listDataHeader. ListDataChild.put(listDataHeader.get(0), OS) // Header, Child data GetChildView() – Returns view for list child itemįor Creating Adapter you have to create DataList for ExpandableListView like below: * Preparing the list data getGroupView() – Returns view for the list group header This class provides required methods to render listview. First one is for main listview, 2nd one for list view group item and 3rd one is for list view child item.Ĭreate a new class file called ExpandableListAdapter.java and extend this from BaseExpandableListAdapter.

In order to create an expandable list view, we need three xml layout files. It has the capability of expanding and collapsing the groups when user touches header.

Create an ExpandableListAdapter instance in activity java file. Expandable list view is used to group list data by categories. Create a layout xml file, add ExpandableListView xml element in it.
