ExpandableListView collapse All - Android android.widget

Android examples for android.widget:ListView

Description

ExpandableListView collapse All

Demo Code

import android.widget.ExpandableListView;

public class Main {

  public static void collapseAll(ExpandableListView expandableListView) {
    int groupCount = expandableListView.getAdapter().getCount();
    for (int i = 0; i < groupCount; i++) {
      expandableListView.collapseGroup(i);
    }/*from  w w  w.  j a  v  a2  s  .c  o m*/
  }

}

Related Tutorials