enter code here
convertView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
for (int i = 0; i < tempChild.size(); i++) {
if(i!=childPosition)
tempChild.get(i).setCheck(false);
else {
tempChild.get(i).setCheck(true);
}
}
}
答案 0 :(得分:0)
尝试以下代码
for(int j=0;j<tempGroup.size();j++)
{
for (int i = 0; i < tempGroup.get(j).gettempChild.size(); i++) {
if(i!=childPosition)
tempGroup.get(j).gettempChild.get(i).setCheck(false);
else {
tempGroup.get(j).gettempChild.get(i).setCheck(true);
}
}
}