Expandablelistview点击儿童

时间:2014-03-14 08:54:03

标签: android expandablelistview

如何实现点击子项以显示布局?

我基于example

应该是这样的:

      @Override
        public void onClick(View view) {
    if(View.equals.("Core")
        {
          //code
        }      
        }
    });

2 个答案:

答案 0 :(得分:0)

将OnChildClickListener添加到ExpandableListView。

@Override
public boolean onChildClick (ExpandableListView parent, View v, int groupPosition, int childPosition, long id){
    // your code here
}

文档:http://developer.android.com/reference/android/widget/ExpandableListView.OnChildClickListener.html

答案 1 :(得分:0)

试试这个

 expListView.setOnChildClickListener(new OnChildClickListener() {

        @Override
        public boolean onChildClick(ExpandableListView parent, View v,
                int groupPosition, int childPosition, long id) {
            // TODO Auto-generated method stub

        }
    });