get first item only in a Android ListView? -


how first list item in listview? want @ textview in first list item. doing this:

view listitem=(view)mylist.getchildat(0); textview txtdep=(textview)listitem.findviewbyid(r.id.txtdepart); txtdep.settext("hello!"); 

but not changing text in first item in every 8th, 16th , on items. change text in first(top) item only. thank you.

views recycled textview used many different items in list. if want change specific item displays need change data behind listitem , being served listadapter (in getview() method). whenever listview shows item in list, adapter show correct data in textview.

and when change data in list or whatever, need call notifydatasetchanged() on adapter.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -