在 ListView 中滚动几次后,我收到此错误并且我的应用程序崩溃。 我正在像这样在 getView 上将图像加载到 ImageView 中:
Image = (ImageView)row.findViewById(R.id.image_list);
Picasso Img= new Picasso.Builder(context).build();
Img.load(R.drawable.test)
.transform(new RoundedTransformation(6,0))
.fit()
.into(Image);
即使我删除了转换,它也会发生。
请不要为每次下载创建一个新的Picasso
实例。
使用单例。
Picasso.with(context).load(...)
或者创建自己的单身人士并使用它。
啊,解决了它。 谢谢,你可以解决这个问题...
另外,不要为每个请求创建一个新的RoundTransformation
对象。
制作一次并重复使用。
最有用的评论
请不要为每次下载创建一个新的
Picasso
实例。使用单例。
或者创建自己的单身人士并使用它。