The code below would fix an issue where a bitmap would have been recycled
twice.
This would not fix the issue where a bitmap would have been recycled where
it should have never been recycled at all.
BTW: the boolean expression (bitmap1 != bitmap2) or (bitmap1 == bitmap2) is
very fast. It is jus
I have had the same problem with some devices, but I did not study the
case in deep, just applied this workaround directly:
if ( ! oldBitmap.isRecycled())
oldBitmap.recycle();
It may be faster than comparing one bitmap to another, but to be honest
I did not try the other method.
Regards,
O
Ah, yes, thanks Romain, that was it! Cheers.
On Sunday, 15 July 2012 06:45:58 UTC+10, Romain Guy (Google) wrote:
>
> Ah, this is an interesting bug that we ran into ourselves.
> createScaledBitmap() can return the *same* bitmap if the scaled copy would
> have the same dimensions as the original
Ah, this is an interesting bug that we ran into ourselves.
createScaledBitmap() can return the *same* bitmap if the scaled copy would
have the same dimensions as the original image. The proper way to do this
is to write:
bitmap = Bitmap.createdScaledBitmap(oldBitmap, etc...);
if (bitmap != oldBitm
Hi Google,
My app that has been running for over 2 years without an update, finally
broke with Jelly Bean. The error: "Sorry, an error has occurred: bitmap is
recycled".
The problem was with calling recycle on a bitmap:
Bitmap bitmapOld = bitmap;
bitmap = Bitmap.createScaledBitmap(bitmap, new
5 matches
Mail list logo