Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finished Download Items Data , Removed From Database #83

Open
majidas2006 opened this issue Sep 17, 2016 · 1 comment
Open

Finished Download Items Data , Removed From Database #83

majidas2006 opened this issue Sep 17, 2016 · 1 comment

Comments

@majidas2006
Copy link

Hi
when a file is downloaded completely and you close app and open again , Fully Downloaded Files are not specifid in the download manager list, only semi downloaded files data can specified
why ThredInfo Table gets clear after file download gets finished ?
how i can handle that a file is completely downloade and on next opening app install it?

@Qamhan
Copy link

Qamhan commented Mar 9, 2017

hi @majidas2006 ,

you can fix the problem by add this line in DownloadTaskImpl class:
updateDB(mThreadInfo);

inside Run like following:

@Override
public void run() {
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
insertIntoDB(mThreadInfo);
try {
mStatus = DownloadStatus.STATUS_PROGRESS;
executeDownload();
synchronized (mOnDownloadListener) {
//add the following line in your run function
updateDB(mThreadInfo);
mStatus = DownloadStatus.STATUS_COMPLETED;
mOnDownloadListener.onDownloadCompleted();
}
} catch (DownloadException e) {
handleDownloadException(e);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants