我正在开发一个具有ExpandableListActivity的应用程序。当一个群体没有孩子时,我希望它显示一条消息,表明没有孩子出现。
答案 0 :(得分:0)
expandableListView.setOnGroupClickListener(new OnGroupClickListener() {
@Override
public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
if(adapter.getChildrenCount(groupPosition)==0) {
//show message
return true;
}
return false;
}
});