Closed sajadmartiny closed 8 years ago
You want to not resuming the download when you start download with the same tag again?
if(DownloadManager.getInstance().isRunning(tag)){
// has callback
DownloadManager.getInstance().cancel(tag);
}else{
// no callback
DownloadManager.getInstance().delete(tag);
}
I made some changes last night and fixed some bugs. Make sure to use the latest version.
i want delete my file and thread from database when my download pause
public void delete(String tag) {
DownloadInfo downloadInfo = getDownloadInfo(tag);
if (downloadInfo != null) {
File file = new File(downloadInfo.getDir(), downloadInfo.getName());
if (file.exists() && file.isFile()) {
file.delete();
}
}
mDBManager.delete(tag);
}
return exception because downloadInfo.getName return null
and i test delete from thread database with tag but do not work and thread didn't delete from table
final DownloadRequest request = new DownloadRequest.Builder()
.setName(appInfo.getName() + ".apk")
.setUri(appInfo.getUrl())
.setFolder(mDownloadDir)
.build();
Did you setName(...)
?
yes i set name but i am fix it whit public void delete(String tag) { String key = createKey(tag); mDBManager.delete(key); } if not delete from data base when re downloading file , could not open file because damaged and Thanks you for library
hi , how to remove one thread from database when file not downloading full , and adding again not downloading continuation