毕加索图片未加载

时间:2018-04-03 18:24:05

标签: android picasso

我使用以下代码在gridView中显示图片: -

 Picasso.get().load(wallpaperInfo.getThumbPicUrl()).fit().into(imgView);

完美无缺。我的gridView上有onItemClickListener(),它将我带到另一个活动,我在那里显示Image并再次从URL加载它。

Picasso.get().load(wallpaper.getPicUrl()).into(new Target() {
    @Override
    public void onBitmapLoaded(Bitmap bitmapS, Picasso.LoadedFrom from) {
        bitmap = bitmapS;
        imageView.setImageBitmap(bitmap);
        onLoadImageData();
        progressBar.setVisibility(View.GONE);
    }

    @Override
    public void onBitmapFailed(Exception e, Drawable errorDrawable) {

    }

    @Override
    public void onPrepareLoad(Drawable placeHolderDrawable) {
        progressBar.setVisibility(View.VISIBLE);
    }
});

现在问题是一些图像加载而一些不加载。 (我认为大图像不会丢失)但是在我点击后再次按下我的gridView项目时,图像加载!我哪里出错或者我不知道?

我的毕加索日志: -

D/Picasso: Hunter      decoded      [R7]+1557ms 
04-04 00:37:12.922 14080-14461/we_pirate.one.com.opw D/Picasso: Dispatcher  batched      [R7]+1562ms for completion
04-04 00:37:12.950 14080-14080/we_pirate.one.com.opw D/Picasso: Main        canceled     [R7]+1590ms target got garbage collected
04-04 00:37:13.132 14080-14461/we_pirate.one.com.opw D/Picasso: Dispatcher  delivered    [R7]+1769ms 
04-04 00:37:13.134 14080-14080/we_pirate.one.com.opw D/Picasso: Main        completed    [R7]+1769ms from DISK

1 个答案:

答案 0 :(得分:0)

在删除.fit()

之后,请先检查您使用的版本

here