How can i select whole listitems when clicking either on checkbox or anywhere in the line
I have a listview with开发者_开发百科 checkbox,now i want to check/uncheck the listitems by clicking anywhere on the listitems eithe on checkbox or on image of listitems or anywhere in the listitem lines. Pease help me out??
Put it into the OnItemClickListener.
ListView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
CheckBox cb = (CheckBox) view.findViewById(R.id.listViewItemCb);
cb.setChecked(true);
// ... other stuff
}
});
精彩评论