I am using inBitmap to load bitmap on android3+. But I always get java.lang.IllegalArgumentException: Problem decoding into existing bitmap.
In LruCache's entryMoved()
function: I use reusableBitmaps.add(new SoftReference<Bitmap>(oldValue.getBitmap()));
to keep bitmap.
and next time to load bitmap: I use iterator on reusableBitmaps to find which one I can use for inBitmap, I use iterator to find which one, just like managing memory on official developer website.
But unfortunately, failed always, logcat shows java.lang.IllegalArgumentException: Problem decoding into existing bitmap.
Anyone can give me a sample or tutorial?
I fixed this using:
options.inSampleSize = 1;
This is a tip from the video mentioned at the second comment to the question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With