I'm uploading an image to the firebase database and I want to show it in progress but it always gets 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();
}
}
});