【发布时间】:2015-04-18 03:38:38
【问题描述】:
我有一个 ExanpdableLisView,我必须为孩子实现 setOnChildClickListener 方法,为组/父实现“LongClick”。
我给孩子穿了一个,但我不知道如何实现 LongClick。
这是setOnChildClickListener的代码
expListView.setOnChildClickListener(new OnChildClickListener() {
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
RosterEntry rentry = (RosterEntry) exListAdapter.getChild(groupPosition, childPosition);
final String selected = rentry.getName();
//Change Toast to make the new functionality
Toast.makeText(getBaseContext(), selected, Toast.LENGTH_LONG).show();
return true;
}
});
但我不知道如何在 Group/parent 上进行 LongClick。
【问题讨论】:
标签: java android android-listview expandablelistview