修复不支持断点文件大小找不到的问题

This commit is contained in:
AriaLyy
2017-03-14 19:41:37 +08:00
parent 2255b0fe0c
commit 4d6d87375e
6 changed files with 10 additions and 7 deletions

View File

@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
buildToolsVersion '25.0.2'
defaultConfig {
minSdkVersion 9

View File

@ -244,7 +244,8 @@ public 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;
@ -254,6 +255,7 @@ public class DownloadUtil implements IDownloadUtil, Runnable {
entity.isSupportBreakpoint = isSupportBreakpoint;
SingleThreadTask task = new SingleThreadTask(mConstance, mListener, entity);
mFixedThreadPool.execute(task);
mListener.onPostPre(len);
mListener.onStart(0);
return;
}