How to display the upload progress bar in each line of the listView?
I want to set a progress bar in each row of the ListView. A progress bar should start or show the progress of uploading the file. I want to set this progress bar in each row of the ListView. The progress bar will be the start progress after completing a progress, one after the other.
Solution
First, you
need to create a custom ArrayAdapter
and add a progress bar for each element, which you can achieve to your bloated layout by adding a ProgressBar
. After that you’ll want to capture the upload listener so you can hear the progress and update the progress bar. If you want them to upload one at a time, I recommend adding a variable to your object or creating an ArrayList<Boolean>
. Check that the previous element has been uploaded.
Example of how to create an ArrayAdapter
It also shows how to create a layout for the rows you want to inflate.