修改暂停的下载也算下载

This commit is contained in:
huangzhuanghua
2016-10-11 14:41:59 +08:00
parent 28e7bd5304
commit ec9219ac7f
3 changed files with 21 additions and 15 deletions

View File

@ -134,17 +134,19 @@ public class DownloadThread extends Thread {
break;
}
}
if (status != DownloadStatus.pause
&& status != DownloadStatus.cancel) {
listener.onStatusChanged(DownloadStatus.done);
}
bos.flush();
Utils.log(DownloadThread.class.getSimpleName(),
"flush==>" + targetFile.length() + ",progress==>"
+ entry.getProgress());
+ entry.getProgress() + ",size==>" + entry.getSize());
bis.close();
bos.close();
// if (status != DownloadStatus.pause && status != DownloadStatus.cancel) {
// listener.onStatusChanged(DownloadStatus.done);
// }
if (targetFile.length() == entry.getSize()) {
listener.onStatusChanged(DownloadStatus.done);
}
}
} catch (Exception e) {
String errorMsg = Log.getStackTraceString(e);