Q:

Adapter with checkbox checked random items

I want to create adapter to my Intervention model. 
Item will have two textviews with checkbox. Intevention model have many String fields only.
My adapter extending Basedapter:
public class CBAdapter extends BaseAdapter {

private LinkedList<Intervention> mData;
private Context mContext;

public CBAdapter(Context context, LinkedList<Intervention> data) {
    mContext = context;
    this.mData = data;
}

static class ViewHolder {
    TextView tvTopText;
    TextView tvLowText;
    CheckBox checkbox;
}

@Override
public int getCount() {
    return mData.size();
}

@Override
public Intervention getItem(int position) {
    return mData.get(position);
}

@Override
public long getItemId(int position) {
    return 0;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder viewHolder;
    if (convertView == null) {
        viewHolder = new ViewHolder();
        convertView = LayoutInflater.from(mContext).inflate(R.layout.intervention_select_item,
                null);
        viewHolder.tvTopText = (TextView) convertView.findViewById(R.id.tvTopText);
        viewHolder.tvLowText = (TextView) convertView.findViewById(R.id.tvBotText);

        viewHolder.checkbox = (CheckBox) convertView.findViewById(R.id.cbInterCheck);

        convertView.setTag(viewHolder);
    } else {
        viewHolder = (ViewHolder) convertView.getTag();
    }
    final int pos = position;
    viewHolder.tvTopText.setText(mData.get(position).getName());
    viewHolder.tvLowText.setText(mData.get(position).getGlobalInterId());

    viewHolder.checkbox
            .setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                    mData.get(pos).setSelected(isChecked);
                }
            });
    return convertView;
}

public void setData(LinkedList<Intervention> data) {
    this.mData = data;
    this.notifyDataSetChanged();
}

}
But when i'm clicking, for example, third item, it will checked 3  and 13 items.
What problem? And how to create adapter with checkboxes? :( 

A:

You are not implementing "convertView" recycling properly. This line does not throw an error, but is incorrect:
viewHolder = (ViewHolder) convertView.getTag();

"getTag" returns type "Object" so it casts, but it isn't what you want. It should be:
viewHolder = (ViewHolder) convertView;

Then your views should each have their own CheckBox.

