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
Post a Comment