public ArrayList<Boolean> isCheckList = new ArrayList<Boolean>(); // 保存checkbox的点击状态
cb.setChepublic View getGroupView(final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent)cked(isCheckList.get(groupPosition)); cb.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (isCheckList.get(groupPosition)) { isCheckList.set(groupPosition, false); } else { isCheckList.set(groupPosition, true); } } });
for (int i = 0; i < groupData.size(); i++) { if (adapter.isCheckList.get(i)) { // 获取选中的删除个数 temp += 1;// 判断选中几项 listDelGId.add(i); } }