Android ListView Some Questions -
i have questions listview
. post i've searched doesn't satisfy me.
if have 5 list items , call
notifydatasetchanged()
method incustomadapter
, how many timesgetview
method called?i have checkbox on each list , must shown when delete button clicked. delete button created on activity class, , checkbox created in adapter class (i mean
findviewbyid
). how can handle this? code changes flag value on activity class , call notifydatasetchanged() method on adapter class.how can handle ui without call
notifydatasetchanged()
method? (i've implemented in way...)
sorry not posting code.
- get view calls every time when item appears @ screen, in case 5 times.
you can that:
2.1 create public method in adapter, example:
public void setisdeletemodeenabled(boolean isenabled) { //logic here }
2.2 in
activity
, whenbutton
clicked calladapter.setdeletemodeenabled(true);
3 should call notifydatasetchanged()
when dataset changed. handling ui events should:
in list item: should set onclicklisteners in getview()
;
in activity
: oncreate()
method in adapter , call in activity
's onclicks
Comments
Post a Comment