我需要在ImageView中显示图片并将其下载到本地文件夹。使用毕加索库。当图像加载时我想显示下载的ProgressBar。
Picasso.with(mContext)
.load(MYurl.BASE_URL + "/" + getItem(position).getImgThumb())
.into(viewHolder.asanaImg);
答案 0 :(得分:4)
请尝试以下picaso回调函数并将位图保存到本地文件夹
Picasso.with(getContext()).load(url).into(new Target() {
@Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
// cache is now warmed up
}
@Override public void onBitmapFailed(Drawable errorDrawable) { }
@Override public void onPrepareLoad(Drawable placeHolderDrawable) { }
});