修复部分bug
This commit is contained in:
@ -9,8 +9,6 @@ import com.gh.common.util.FileUtils;
|
||||
import com.gh.common.util.Utils;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
public class DownloadTask implements DownloadListener {
|
||||
|
||||
@ -138,16 +136,9 @@ public class DownloadTask implements DownloadListener {
|
||||
|
||||
/*********************** 处理网络异常 ***********************/
|
||||
if (status == DownloadStatus.timeout || status == DownloadStatus.neterror) {
|
||||
Map<String, DownloadTask> taskMap = DataChanger.getInstance().getDownloadingTasks();
|
||||
Iterator<String> iterator = taskMap.keySet().iterator();
|
||||
String key;
|
||||
while (iterator.hasNext()) {
|
||||
key = iterator.next();
|
||||
DownloadTask task = taskMap.get(key);
|
||||
if (task != null) {
|
||||
task.pause();
|
||||
}
|
||||
iterator.remove();
|
||||
DownloadTask task = DataChanger.getInstance().getDownloadingTasks().remove(entry.getUrl());
|
||||
if (task != null) {
|
||||
task.pause();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user