How can I change the position of an item in ListView dynamically in android -


i want change position of item in listview dynamically.how can that?

the listview backed data structure (e.g. list<string>). can do

pseudocode:

list<string> list = ... listview lv = .. adapter = new adapter(..., list); lv.setonclicklistener(this);  onitempressed(..., int position, ...) {    tmp = list.get(0);    list.set(0, list.get(position));    list.set(position,tmp);    a.notifydatasetchanged(); } 

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 -