Downloading file progress bug
See original GitHub issueHi creator of this useful library. I try download large file 80mb. So, exactly downloading of file are complete without bug. But onProgress method, stop call sometime are magically principe, and never called while file will be downloaded completely. What I’m do wrong ? Please help me.
final File temp = Tool.createTempFile();
AndroidNetworking.download(url, temp.getParentFile().getPath(), temp.getName())
.setTag("downloadFile")
.setPriority(Priority.HIGH)
.build()
.setDownloadProgressListener(new DownloadProgressListener() {
private int prevProgress;
@Override
public void onProgress(final long bytesDownloaded, final long totalBytes) {
final int progress = (int) (bytesDownloaded * 100 / totalBytes);
if (progress != prevProgress) {
progressBar.setProgress(progress);
percent.setText(progress + " %");
prevProgress = progress;
Log.e("progress", "total = " + totalBytes +
" loaded = " + bytesDownloaded + " percentage = " + progress + "%");
}
}
})
.startDownload(new DownloadListener() {
@Override
public void onDownloadComplete() {
progressBar.setProgress(100);
cancel.setEnabled(false);
IntentFilter filter = new IntentFilter();
filter.addAction(DataImportService.SERVICE_FILTER);
activity.registerReceiver(broadcastReceiver, filter);
}
@Override
public void onError(ANError error) {
progressBar.setVisibility(View.GONE);
progressBar.setProgress(0);
percent.setText(getContext().getResources().getString());
dismiss();
}
});
progressBar.setProgress(0);
progressBar.setVisibility(View.VISIBLE);
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
All browsers download progress not showing and File Explorer
Hi, I figured out why my download progress bar wasn't showing in browser, it was an app and an extension blocking it. Thanks...
Read more >Download in progress but cuts out: how to fix this bug in Chrome
A download in progress is cut off in Chrome · Check for corrupted downloads · Check if any extension is interfering · See...
Read more >[Bug] Negative Downloading Progress while ... - GitHub
Steps to reproduce. Open any video link of drive.google.com, and click download logo on the website page
Read more >Closing Chrome browser gets Download progress stop dialog ...
Issue 145085: Closing Chrome browser gets Download progress stop dialog, ... Please specify Area-* of the system to which this bug/feature applies.
Read more >When downloading extensions, the progress bar indicating ...
When downloading extensions, the progress bar indicating download progress does not update while downloading, then updates to 100% when complete.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s works. Thank you. Good job.
Best regards, Evgeny
@smail2133 : Try it and give me feedback