我想更改可展开列表视图的默认行为 从:
short click => expand / collapse
为:
long click => expand / collapse
short click => select item or child
答案 0 :(得分:0)
好的,似乎最好的解决方案是使用列表项单击/长按一下监听器。
public void onClick(View view)
{
// click - do something with item
}
public boolean onLongClick(View view)
{
// group position was stored in view tag
int groupPosition = (Integer) view.getTag();
ExpandableListView listView = (ExpandableListView) findViewById(R.id.expandableListView);
if (listView.isGroupExpanded(groupPosition))
listView.collapseGroup(groupPosition);
else
listView.expandGroup(groupPosition);
return true;
}