The rollback of the item in the ListView will result in a reuse.
That is, the ListView cache item is certain, after scrolling, update, will be reused in front of the item is no longer used.
So when updating a control, especially a progress bar, it is necessary to judge whether the currently updated item is in the visible item
That is in
listview.getfirstvisibleposition () and between Listview.getlastvisibleposition ()
If it is not, you need to calculate the location that corresponds to which visual item, and then get that item to update the data.
Attach Code Snippet
int firstvisibleposition = musiclistview.getfirstvisibleposition ();
int lastvisibleposition = musiclistview.getlastvisibleposition ();
if (position >= firstvisibleposition && index <= lastvisibleposition< c15>) {
View view = Musiclistview.getchildat (position - firstvisibleposition);
if (view.gettag () instanceof Listadapter.inneritem) {
listadapter.inneritem inneritem = (listadapter.inneritem) View.gettag ();
inneritem. Progreddbar.setprogress ((float) progress/100.0f);
}
}
Android ListView issues with Dynamic Refresh