In an ExpandableListView
is it possible to initially select a child item so that the containing group is expanded and the list is scrolled to this child\'s posi
Add a call to listView.expandGroup()
before setSelectedChild()
.
The shouldExpandGroup
parameter set to true in setSelectedChild()
seems only to work if there's at least one group expanded in the first place.
In an ExpandableListView is it possible to initially select a child item so that the containing group is expanded and the list is scrolled to this child's position:
//select child and open it's group
ExpListView.setSelectedChild(groupPos, childPos, true);
//scroll to selected child
ExpListView.smoothScrollToPosition(ExpListView.getFlatListPosition(ExpListView.getPackedPositionForChild(groupPos, childPos)));