Example usage for android.widget ExpandableListView getAdapter

List of usage examples for android.widget ExpandableListView getAdapter

Introduction

In this page you can find the example usage for android.widget ExpandableListView getAdapter.

Prototype

@Override
public ListAdapter getAdapter() 

Source Link

Document

This method should not be used, use #getExpandableListAdapter() .

Usage

From source file:Main.java

public static void collapseAll(ExpandableListView expandableListView) {
    int groupCount = expandableListView.getAdapter().getCount();
    for (int i = 0; i < groupCount; i++) {
        expandableListView.collapseGroup(i);
    }//  w  w  w.  java 2 s . c  o  m
}

From source file:Main.java

public static void collapseAllExcept(ExpandableListView expandableListView, int index) {
    int groupCount = expandableListView.getAdapter().getCount();
    for (int i = 0; i < groupCount; i++) {
        if (index != i) {
            expandableListView.collapseGroup(i);
        }/* w w  w . j a  v  a2s  . com*/
    }
}

From source file:Main.java

public static void expendAll(ExpandableListView expandableListView) {
    if (expandableListView == null || expandableListView.getAdapter() == null) {
        return;//  w  ww  .j a  v a  2 s . c  om
    }
    int groupCount = expandableListView.getAdapter().getCount();
    // System.out.println("+++++++++++++");
    // System.out.println(groupCount);
    for (int i = 0; i < groupCount; i++) {
        try {
            expandableListView.expandGroup(i);
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }
}