This commit is contained in:
hyb1996
2018-02-04 14:41:23 +08:00
parent 9a64b1ef2b
commit 2e1f09061c

View File

@@ -76,7 +76,7 @@ public class DownloadManager {
DownloadTask task = new DownloadTask(url, path); DownloadTask task = new DownloadTask(url, path);
mDownloadApi.download(url) mDownloadApi.download(url)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.subscribe(task::start); .subscribe(task::start, error -> task.progress().onError(error));
return task.progress(); return task.progress();
} }
@@ -163,7 +163,7 @@ public class DownloadManager {
} }
public Observable<Integer> progress() { public PublishSubject<Integer> progress() {
return mProgress; return mProgress;
} }