runOnUiThread(new Runnable() {
@Override
public void run() {
rel_showProgress.setVisibility(View.VISIBLE);
float totalMb = (float) totalBytesDownloaded / (1024 * 1024);
String size = String.format(Locale.ENGLISH, "%.2f", totalMb);
txt_progress.setText(msg);
String tempSize = size + " MB";
txt_fileSize.setText(tempSize);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
progressBar.setProgress((int) finalProgressPercent, true);
} else progressBar.setProgress((int) finalProgressPercent);
}
});
I am using this code and show download progress in a activity. but the problem is when i do multiple downloads then it overlaps. so i want to set downloads on recycler view or listview. but i am not able to figure it out that how can i set progress on recycler view progress bar. because recycler or listview take data from the arraylist or any other. so how can i set dynamic data on it.