friends,
i am using following code to check/uncheck checkboxs inside listview
public AdapterBank(Context context,List list,ListView lst)
You could try to have a static listener (might not correct your bug but will surely lower the number of "temp" objects you are creating):
public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.list_banks, null);
holder = new ViewHolder();
holder.bankName = (TextView) convertView.findViewById(R.id.bankName);
holder.bankIcon = (ImageView) convertView.findViewById(R.id.bankIcon);
holder.checkBox = (CheckBox) convertView.findViewById(R.id.checkBox);
holder.checkBox.setOnCheckedChangeListener(checkListener);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
Bank bank = getItem(position);
holder.checkBox.setTag(bank);
holder.checkBox.setChecked(bank.isSelected());
return convertView;
}
private OnCheckedChangeListener checkListener = new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton checkboxView, boolean isChecked) {
Bank b = (Bank) checkboxView.getTag();
b.setSelected(isChecked);
}
});