I want to add just one checkbox in a listview, I was researching and just found how to make it with checkbox in all its rows but I want it in just one row.
Thanks in advance
--edit--
thank you @Gaurav, I was researching and I could do it but now when I try to click the item with the checkbox it wasn't clicked
BaseAdapter
public View getView(int arg0, View arg1, ViewGroup arg2) {
View v = arg1;
if(arg1 == null){
LayoutInflater inf = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = inf.inflate(R.layout.row, null);
}
Articulos art = items.get(arg0);
TextView nombre = (TextView) v.findViewById(R.id.tvNombreRow);
nombre.setText(art.getNombre());
CheckBox check = (CheckBox) v.findViewById(R.id.chkCuadroRow);
check.setChecked(art.getEstado());
if(art.getVisible()){
check.setVisibility(View.VISIBLE);
}else{
check.setVisibility(View.INVISIBLE);
}
return v;
}
Main
ArrayList<Articulos> arrayList = new ArrayList<Articulos>();
Articulos articulos;
articulos = new Articulos("Color de fondo",false,false);
arrayList.add(articulos);
articulos = new Articulos("Vencimiento de bonos",false,false);
arrayList.add(articulos);
articulos = new Articulos("Comparte esta aplicacion",false,false);
arrayList.add(articulos);
articulos = new Articulos("Visualizador de tiempo",true,true);
arrayList.add(articulos);
articulos = new Articulos("Configuración",false,false);
arrayList.add(articulos);
articulos = new Articulos("Tutorial",false,false);
arrayList.add(articulos);
articulos = new Articulos("Acerca de",false,false);
arrayList.add(articulos);
articulos = new Articulos("Salir",false,false);
arrayList.add(articulos);
BaseAdapterCustom adapter = new BaseAdapterCustom(this, arrayList);
lstConfiguracion.setAdapter(adapter);
what could be the problem?