-
Notifications
You must be signed in to change notification settings - Fork 285
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
看过您的代码,非常感谢 #23
Comments
首先,感谢你的宝贵意见。周末比较忙,没来的急回复。在零碎的时间里仔细考虑了一下你的建议。 在java命名规则中以new打头的方法,newSomeThing(),都会返回一个SomeThing的对象。比如volley的newRequestQueue(...)返回一个RequestQueue对象,Executors.newFixedThreadPool(...)返回一个ThreadPoolExecutor对象。 所以我会考虑改成: |
点击暂停,就异常终止闪退了 |
@mattxzhang |
机型是小米2,系统5.0.2,就是下载时点击暂停就异常终止了,你的代码暂时没看,只是先看下效果 |
刚又试了下,不是机型的问题,操作步骤就是频繁点击(暂停,开始),滚动,就闪退了,测试了其他手机都是如此 |
@mattxzhang |
github页面下载的demo.apk,只需要频繁点击下载-暂停,就崩溃了,很好复现 |
@mattxzhang 两周内我会重构一次,到时候api可能会有所调整。 我已经将此问题移到 #25 |
在慕课网上看到您的连接过来,之后就看了代码。非常感谢,从中学习到很多内容。
这里有点小建议,个人看法。
我觉得如果DownloadManager.getInstance().init();换成是,下面的写法,可能更灵活和方法,抄Volley,相信您也看过。
DownloadManager.newManager(context);设置默认的配置
DownloadManager.newManager(context,config);自定义配置,config里装filePath,ExecutorService。
这样用户一次定义完下载目录,和自己配置线程池。要么就使用您给的默认配置。也不需要再App里初始化,在用的UI页面就行。
manager.load(file,url,callback); 这里就不要file这个参数了,每次都写挺麻烦的。
The text was updated successfully, but these errors were encountered: