ExpandableListView expend All - Android android.widget

Android examples for android.widget:ListView

Description

ExpandableListView expend All

Demo Code

import android.widget.ExpandableListView;

public class Main {

  public static void expendAll(ExpandableListView expandableListView) {
    if (expandableListView == null || expandableListView.getAdapter() == null) {
      return;/* w ww  . j  av a 2  s .c  o  m*/
    }
    int groupCount = expandableListView.getAdapter().getCount();

    for (int i = 0; i < groupCount; i++) {
      try {
        expandableListView.expandGroup(i);
      } catch (Exception exception) {
        exception.printStackTrace();
      }
    }
  }

}

Related Tutorials