Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

刚点击开始下载,马上dlStop,就会onError: 101 XXXX is downloading. #37

Open
0xm1nam0 opened this issue Apr 21, 2016 · 2 comments

Comments

@0xm1nam0
Copy link

刚点击开始下载,马上dlStop,再点击开始就会一直onError: 101 XXXX is downloading.,无论是取消下载还是会onError: 101 XXXX is downloading

@0xm1nam0
Copy link
Author

应该是概率性会出现一直onError: 101 XXXX is downloading,感觉是网络弱的时候会,很久都不关闭线程,无论我在onError: 101的时候调用dlStop,还是没效果

@Alex-Cin
Copy link

Alex-Cin commented Aug 23, 2016

这样就解决了

/**
* 根据Url暂停一个下载任务
* Stop a download task according to url.
*
* @param url 文件下载地址
* Download url.
*/
public void dlPause(String url) {
if (TASK_DLING.containsKey(url)) {
DLInfo info = TASK_DLING.get(url);
info.isStop = true;
if (!info.threads.isEmpty()) {
for (DLThreadInfo threadInfo : info.threads) {
threadInfo.isStop = true;
}
}
}
if (TASK_DLING != null) {
TASK_DLING.remove(url);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants