i have a question, been stuck for a while, i dont know how can i add a checkbox in the list, for example if I have a list of items i want to be able to check them. my xml c
public class myAdapter extends SimpleCursorAdapter {
public myAdapter(Context context, int layout, Cursor cursor, String[] from, int[] to) {
super(context, layout, cursor, from, to);
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
cb=(CheckBox)view.findViewById(R.id.cb);
cb.setText(dbgetStringValue);
cbText=(TextView)view.findViewById(R.id.cbText);
cbText.setText(dbgetStringValue);
cb.setChecked(false);
cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton cb, boolean isChecked) {
if(cb.isChecked()) {
// action
}
else if(isChecked==false) {
// action
}
}
});
}
}
is that what you want?