test
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
<!--注意,修改该配置文件中的属性会覆盖代码中所设置的属性-->
|
||||
<download>
|
||||
|
||||
<!--设置下载线程,线程下载数改变后,新的下载任务才会生效-->
|
||||
<!--设置下载线程,线程下载数改变后,新的下载任务才会生效,如果任务大小小于1m,该设置也不会生效-->
|
||||
<threadNum value="4"/>
|
||||
|
||||
<!--是否打开下载广播,默认为false,不建议使用广播,你可以使用Download注解来实现事件回调-->
|
||||
|
@ -56,14 +56,17 @@ public class TestMutilTaskSysDownload extends BaseActivity<TestActivityMultiBind
|
||||
int maxNum = Aria.get(this).getDownloadConfig().getMaxTaskNum();
|
||||
for (int i = 0; i < urlArray.length; i++) {
|
||||
if (i < maxNum) {
|
||||
|
||||
Aria.download(this)
|
||||
.load(baseUrl + urlArray[i])
|
||||
.setDownloadPath(Environment.getExternalStorageDirectory() + "/test/" + i + ".jpg")
|
||||
//.addHeader("Accept-Encoding", "gzip,deflate,sdcn")
|
||||
.start();
|
||||
} else {
|
||||
Aria.download(this)
|
||||
.load(baseUrl + urlArray[i])
|
||||
.setDownloadPath(Environment.getExternalStorageDirectory() + "/test/" + i + ".jpg")
|
||||
//.addHeader("Accept-Encoding", "gzip,deflate,sdcn")
|
||||
.add();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user