我正在使用 BaseAdapter 自定义我的列表视图
public View getChildView(int groupPosition, int childPosition,
boolean isLastChild, View view, ViewGroup parent) {
if (view == null) {
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.products_item, null);
}
FileBean file = (FileBean) ((ExtendedList) (Object) categories.get(groupPosition)).getItem(childPosition);
CheckBox checkBox = (CheckBox) view.findViewById(R.id.fileCheckBox);
if(checkBox != null){
if(mCheckBoxListener != null){
checkBox.setOnCheckedChangeListener(mCheckBoxListener);
}
checkBox.setChecked(file.isChecked());
Log.d("getcview", String.valueOf(file.isChecked() + " " + file.getName()
+ " " + groupPosition + " " + childPosition));
}
setProductDetails(file, view);
ViewHolder holder = new ViewHolder();
holder.groupPosition = groupPosition;
holder.childPosition = childPosition;
Log.d("exadapter", "Child " + file.getName());
view.setTag(holder);
return view;
}