Hi,

Can anyone explain why when I load images from files using
BitmapFactory.decodeFile and passing in a BitmapFactory.Options with
inPurgeable set to true, I still get OutOfMemoryError?

For example, doing the following many times, with lots of different
resources works fine:

BitmapFactory.Options opts = new Options()
opts.inPurgeable = true;
bitmap = BitmapFactory.decodeResource(resources, resId, opts);


However, doing the following causes an OutOfMemoryError

BitmapFactory.Options opts = new Options()
opts.inPurgeable = true;
bitmap = BitmapFactory.decodeFile(myFile, opts);

In reality my code isn't as simple as outlined above. What I'm really
trying to do is load a couple of bitmap resources draw them on a
bitmap backed canvas, and then write this new bitmap to file, just so
it can then be finally re-read into memory with the inPurgeable option
set to true (using BitmapFactory.decodeFile).

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to