This commit is contained in:
AriaLyy
2017-03-14 20:02:07 +08:00
parent bd954be556
commit 81609a1bf6
2 changed files with 19 additions and 15 deletions

View File

@ -250,7 +250,8 @@ final class DownloadUtil implements IDownloadUtil, Runnable {
//不支持断点只能单线程下载
if (!isSupportBreakpoint) {
ConfigEntity entity = new ConfigEntity();
entity.FILE_SIZE = conn.getContentLength();
long len = conn.getContentLength();
entity.FILE_SIZE = len;
entity.DOWNLOAD_URL = mDownloadEntity.getDownloadUrl();
entity.TEMP_FILE = mDownloadFile;
entity.THREAD_ID = 0;
@ -261,6 +262,7 @@ final class DownloadUtil implements IDownloadUtil, Runnable {
entity.DOWNLOAD_TASK_ENTITY = mDownloadTaskEntity;
SingleThreadTask task = new SingleThreadTask(mConstance, mListener, entity);
mFixedThreadPool.execute(task);
mListener.onPostPre(len);
mListener.onStart(0);
return;
}