android - Business logic of the CheckBox listener inside a ListView -
i have implemented custom adapter listview, includes checkbox in each row.
as have click listener in custom adapter, i'm forced implement there business logic (that is, happens when checkbox clicked... access database, etc).
is correct? wouldn't better practice implement business logic outside custom adapter? (i think adapter should care visualization).
try this..hope helps you
lv_archiveist.setonitemclicklistener(new onitemclicklistener(){ @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { // todo auto-generated method stub if(view.findviewbyid(r.id.chkbox).ischecked()) { //your method// //you can position of selected checkbox parameter "position" }
Comments
Post a Comment