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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -