老师,代码有问题
下载图片时会报错,本人亲测,会报java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare(),后来百度说是Handler没有Looper。我的解决方案是在new handler的时候传入looper(new Handler(mContext.getMainLooper())),构造方法中加入context参数,结果就行了。
下载图片时会报错,本人亲测,会报java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare(),后来百度说是Handler没有Looper。我的解决方案是在new handler的时候传入looper(new Handler(mContext.getMainLooper())),构造方法中加入context参数,结果就行了。
2015-05-05
举报