1
這是子元素的onclick監聽器。默認Onclick在expandablelistview中的子元素?
getExpandableListView().setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
// TODO Auto-generated method stub
onChild_Click(parent,v,
groupPosition,childPosition, id);
return true;
}
});
它點擊子元素時正在工作。現在我需要選擇第一個孩子作爲默認(在onCreate()方法內)。 對於擴展組,我正在使用這個。
getExpandableListView().expandGroup(0);
我想這些事,子元素,但是當點擊子,它正在它不發射的onclick event.But。
getExpandableListView().setItemChecked(1, true);
和
getExpandableListView().setSelectedChild(0, 0, true);