AriaLyy 8 years ago
parent 07b3954585
commit b95ab29466
  1. 10
      Aria/src/main/java/com/arialyy/aria/core/download/DownloadTask.java
  2. 3
      README.md
  3. 1
      app/src/main/java/com/arialyy/simple/download/SingleTaskActivity.java

@ -133,10 +133,7 @@ public class DownloadTask extends AbsTask<DownloadTaskEntity, DownloadEntity> {
*/
@Override public void cancel() {
if (!mEntity.isDownloadComplete()) {
mUtil.cancelDownload();
mUtil.delConfigFile();
mUtil.delTempFile();
mEntity.deleteData();
if (!mUtil.isDownloading()) {
if (mOutHandler != null) {
mOutHandler.obtainMessage(DownloadSchedulers.CANCEL, this).sendToTarget();
}
@ -145,6 +142,11 @@ public class DownloadTask extends AbsTask<DownloadTaskEntity, DownloadEntity> {
intent.putExtra(Aria.DOWNLOAD_ENTITY, mEntity);
mContext.sendBroadcast(intent);
}
mUtil.cancelDownload();
mUtil.delConfigFile();
mUtil.delTempFile();
mEntity.deleteData();
}
}
public static class Builder {

@ -25,7 +25,7 @@ Aria怎样使用?
## 下载
[![Download](https://api.bintray.com/packages/arialyy/maven/Aria/images/download.svg)](https://bintray.com/arialyy/maven/Aria/_latestVersion)</br>
```java
compile 'com.arialyy.aria:Aria:3.1.5'
compile 'com.arialyy.aria:Aria:3.1.6'
```
## 示例
@ -277,6 +277,7 @@ Aria.download(this).load(DOWNLOAD_URL).setDownloadPath(PATH).setHighestPriority(
## 开发日志
+ v_3.1.6 [取消任务时onTaskCancel回调两次的bug](https://github.com/AriaLyy/Aria/issues/33)
+ v_3.1.5 优化代码结构,增加优先下载任务功能。
+ v_3.1.4 修复快速切换,暂停、恢复功能时,概率性出现的重新下载问题,添加onPre()回调,onPre()用于请求地址之前执行界面UI更新操作。
+ v_3.1.0 添加Aria配置文件,优化代码

@ -241,6 +241,7 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> {
@Override public void onTaskCancel(DownloadTask task) {
if (task.getKey().equals(DOWNLOAD_URL)) {
mUpdateHandler.sendEmptyMessage(DOWNLOAD_CANCEL);
L.d(TAG, "task__cancel");
}
}

Loading…
Cancel
Save