I have a custom Listview, where each item contains a progressbar. But when the list contains many items, and I use the scrollbar to navigate through listview, some ProgressB
In your ViewHolder
class :
static class ViewHolder {
//...
boolean isUploading = false;
//...
}
In your getView()
:
public View getView(final int position, View convertView, ViewGroup parent) {
//...
if(holder.isUploading) {
holder.uploadProgressBar.setVisibility(View.VISIBLE);
} else {
holder.uploadProgressBar.setVisibility(View.GONE);
}
//...
}
In your startUpload()
:
public void startUpload(final int position) {
//...
holder.uploadProgressBar.setVisibility(View.VISIBLE);
holder.isUploading = true;
//...
}
Hope it will work.