Monday, 15 April 2013

java - How to set checkbox checked? -



java - How to set checkbox checked? -

so created custom listview adapter. every listview's item contains checkbox. , have button check or uncheck checkboxes in listviw. seek so:

// buttons' click listener's code for(int = 0; < list.getcount(); i++) { // list listview view item = adapter.getview(1, null, list); // adapter list's adapter checkbox ch = ((checkbox)item.findviewbyid(r.id.mycheckbox)); ch.setchecked(true); }

as can see seek set checkboxes in listview checked. code perfomed successfully, no exception. checkboxes reman unchecked. why?

change :

view item = adapter.getview(1, null, list);

to :

view item = adapter.getview(i, null, list);

java android checkbox

No comments:

Post a Comment