Android ListView Some Questions -


i have questions listview. post i've searched doesn't satisfy me.

  1. if have 5 list items , call notifydatasetchanged() method in customadapter, how many times getview method called?

  2. 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.

  3. how can handle ui without call notifydatasetchanged() method? (i've implemented in way...)

sorry not posting code.

  1. get view calls every time when item appears @ screen, in case 5 times.
  2. you can that:

    2.1 create public method in adapter, example:

    public void setisdeletemodeenabled(boolean isenabled) {     //logic here } 

    2.2 in activity, when button clicked call adapter.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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -