0
I am uploading an image to the firebase database and I want to show it in the file but it always stays 0/100.
progress=new ProgressDialog(getContext());
progress.setMessage("Downloading Music");
progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progress.setIndeterminate(true);
progress.show();
uploadTask.addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
double p = (100.0 * taskSnapshot.getBytesTransferred()) / taskSnapshot.getTotalByteCount();
int currentprogress = (int) p;
progress.setProgress(currentprogress);
if(currentprogress==100){
progress.dismiss();
}
}
});
The variable that is receiving the progress update is the variable "p" and not "currentprogress", so instead of doing this Progress.setProgress(currentprogress); do Progress.setProgress((int) p);
– thalissonestrela
i forgot to put that part,int currentprogress = (int) p;
– João Otavio