统计下载出错log

This commit is contained in:
huangzhuanghua
2016-10-09 09:49:00 +08:00
parent 8aa90935d8
commit 52f2dd22f2
6 changed files with 74 additions and 12 deletions

View File

@ -113,7 +113,11 @@ public class DownloadTask implements DownloadListener {
@Override
public void onStatusChanged(DownloadStatus status) {
onStatusChanged(status, null);
}
@Override
public void onStatusChanged(DownloadStatus status, String error) {
if (status == DownloadStatus.cancel
|| status == DownloadStatus.hijack) {
entry.setProgress(0);
@ -136,6 +140,7 @@ public class DownloadTask implements DownloadListener {
/*********************** 处理网络异常 ***********************/
if (status == DownloadStatus.timeout || status == DownloadStatus.neterror) {
entry.setError(error);
DownloadTask task = DataChanger.getInstance().getDownloadingTasks().remove(entry.getUrl());
if (task != null) {
task.pause();