我下载了一个包含视图背景图像 URL 的 JSON 字符串。下载代码在里面doInBackground(Object... params)
。对于加载图像,我使用的是 Universal Image Loader。
ImageLoader.getInstance().loadImage(shop.background, new ImageLoadingListener() {
public void onLoadingStarted(String imageUri, View view) {
// TODO Auto-generated method stub
}
public void onLoadingFailed(String imageUri, View view,
FailReason failReason) {
// TODO Auto-generated method stub
}
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
// TODO Auto-generated method stub
Drawable d = new BitmapDrawable(getResources(),loadedImage);
mainLayout.setBackgroundDrawable(d);
}
public void onLoadingCancelled(String imageUri, View view) {
// TODO Auto-generated method stub
}
});
我正进入(状态
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
我哪里错了?