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

Python __call__ special method practical example -

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -