In my application I am making check boxes visible in list view through get view method .but when I click on any check box and scroll down the list ,there are some more check boxes which are getting checked simultaneously though I have never checked them ever.I am unable to find anything in this context.kindly help.
public class viewHolder {
TextView top;
TextView bottom;
TextView below;
TextView idhold;
CheckBox cb;
}
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
viewHolder holder;
if(convertView==null){
LayoutInflater inflator=context.getLayoutInflater();
convertView=inflator.inflate(R.layout.favouritetextviewonly, null);
holder=new viewHolder();
holder.top=(TextView)convertView.findViewById(R.id.topper);
holder.bottom=(TextView)convertView.findViewById(R.id.lower);
holder.below=(TextView)convertView.findViewById(R.id.lowest);
holder.idhold=(TextView)convertView.findViewById(R.id.idholder);
---> holder.cb=(CheckBox)convertView.findViewById(R.id.favouritecheckbox);
convertView.setTag(holder);
}
else{
holder=(viewHolder)convertView.getTag();
}
holder.top.setText(names[position]);
holder.bottom.setText(types[position]);
holder.below.setText(numbers[position]);
holder.idhold.setText(""+keys[position]);
----> holder.cb.setVisibility(View.VISIBLE);
return convertView;
}