I am downloading a pdf file that is stored in firebase storage and would like a progressbar to appear while the download is in progress.
private Long downloadFile(String url) throws IOException {
// I get the url variable of a query in firebase
downloadManeger = (DownloadManager) this.getSystemService(Context.DOWNLOAD_SERVICE);
Uri uri = Uri.parse(url);
DownloadManager.Request request = new DownloadManager.Request(uri);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
return downloadManeger.enqueue(request);
}