martes, 28 de octubre de 2014

Android: Expandable list, expand all groups.

Set the group on click listener:
list.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener()
        {
            public boolean onGroupClick(ExpandableListView arg0, View itemView, int itemPosition,
                    long itemId)
            {
                return true;
            }
        });
When created you need to expand all groups like so:
private void expandGroups() {
        for (int i = 0; i < listAdapter.getGroupCount(); i++) {
            listView.expandGroup(i);
        }
    }

No hay comentarios:

Publicar un comentario