修复不支持断点文件大小找不到的问题
This commit is contained in:
@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.2"
|
||||
buildToolsVersion '25.0.2'
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 9
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user