ProgressBar in Download Manager

0

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);
}
    
asked by anonymous 21.09.2018 / 01:01

0 answers