ExpandableListView の表示で1つのグループだけ開く

ExpandableListView の表示で1つのグループだけ開けるようにするにはセットする Adapter、
public interface ExpandableListAdapteronGroupExpanded を以下のように実装する。

private int currentHourPosition = -1;
@Override
public void onGroupExpanded(int groupPosition){

   if (currentHourPosition != -1 && currentHourPosition != groupPosition){
      expandableListView.collapseGroup(currentHourPosition);
   }
   currentHourPosition = groupPosition;
}

これは、SimpleExpandableListAdapter や、BaseExpandableListAdapter override して
実装する。

さらに Activity を生成して画面に表示した時に、expandGroup メソッド
任意のグループを広げておくのが良いと思う。

ExpandableListView expandableListView = (ExpandableListView)findViewById(R.id.expandableListView);

expandableListView.expandGroup(0);