在 ChildItem 中单击按钮时折叠 ExpandableListView GroupItem

Collapsing ExpandableListView GroupItem on button click within ChildItem

是否可以通过单击 ChildItem 中的按钮来折叠 ExpandableListViewExpandableListAdapterGroupItem

我想要实现的是:

我有一个 ExpandableListView 正在由 ExpandableListAdapter(扩展 BaseExpandableListAdapter

提供

ExpandableListAdaptergetChildView() 方法中,我正在调用一个按钮(插入到子项目布局 xml 中),我想使用它关闭那个特定的 GroupItem 一旦用户阅读完毕。

是的。在调用 listView.collapseGroup(groupNumber)

的按钮上设置 onClickListener