我想在填充可扩展列表视图时展开所有子项.目前我的代码如下所示:
ExpandableListView listView = (ExpandableListView) findViewById(R.id.view);
int count = viewAdapted.getGroupCount();
for (int position = 1; position <= count; position++)
listView.expandGroup(position - 1);
Run Code Online (Sandbox Code Playgroud)
这很难看.有没有更好的方法来做到这一点?