Canvas: trying to use a recycled bitmap android.graphics.Bitmap
See original GitHub issueThere is an issue
java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@f4db2e9
at android.graphics.Canvas.throwIfCannotDraw(Canvas.java:1270)
at android.graphics.Canvas.drawBitmap(Canvas.java:1404)
at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:544)
at com.squareup.picasso.PicassoDrawable.draw(PicassoDrawable.java:96)
at android.widget.ImageView.onDraw(ImageView.java:1246)
at android.view.View.draw(View.java:16184)
at android.view.View.updateDisplayListIfDirty(View.java:15180)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15175)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.widget.AbsListView.dispatchDraw(AbsListView.java:2615)
at android.view.View.draw(View.java:16187)
at android.widget.AbsListView.draw(AbsListView.java:4166)
ListAdapter getView code
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
View rowView = convertView;
if (rowView == null) {
rowView = inflater.inflate(R.layout.list_item_coupons, null);
}
ImageView image = (ImageView) rowView.findViewById(R.id.image);
String url = BuildConfig.imagesUrl + mList.get(position).getImage();
Picasso.with(context)
.load(url)
.into(image);
return rowView;
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Canvas: trying to use a recycled bitmap android.graphics ...
In my case error was caused because I changed visibility from gone to visible (or vice versa) of an element of the layout....
Read more >Canvas: trying to use a recycled bitmap, Glide 4.9.0 #3594
I have one place (in BitmapTransformation for glide's .transform() ) in application where I do bitmap.recycle() - can it be the problem?
Read more >Android : Canvas: trying to use a recycled bitmap ... - YouTube
Android : Canvas : trying to use a recycled bitmap android.graphics.Bitmap in Android [ Beautify Your Computer ...
Read more >java.lang.RuntimeException: Canvas: trying to use a recycled ...
RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@41371280 at android.graphics.Canvas.throwIfRecycled(Canvas.java:1038) at ...
Read more >Canvas: trying to use a recycled bitmap android.graphics
复现很容易:写一个Bitmap,调用Bitmap的recycle()方法将其回收掉,再设置给ImageView。 1. 2. mBitmap.recycle();. mImageView.setImageBitmap( ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For now I solve issue with
CustomImageView
and to reduce requests. I change in adapter
getView
you can try set memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_STORE)