Don't feel sorry Bob,

Your answer was totally appropriate and a good read, I didn't know
that this fragmentation problem could occur.
It was not the answer to this one, but again, you made Fadden give a
thorough explanation(Thank you Fadden). That's how forums and ideas
work, make them bounce :)

Greg's answer to your improvement suggestion was totally inapropriate,
I think he is at his time of the month, and I'm glad you didn't use
your last wording fist because without all the tedious explanation of
the background I would not have understood it :D
BTW, this place is as close as Academia as we can get on the
internet.
And I like it that way, I come everyday and  I'm trying to graduate in
both "Tips and Trick 101" and "Theory 101".
And everything I learn makes it into my code which sometimes translate
into money.

Back to the topic, I also hit that problem 2 days ago while setting
Bitmaps in ImageViews this is how I solved it :

//First we clear the data from the old image to free up memory
photoPreview.destroyDrawingCache(); //No clue if thats helps, more
like Greg does, tries and if it works, well good for me
photoPreview.setImageBitmap(null); //Make sure the bitmap is not
allocated anymore
System.gc();//Sends the Walkyries on the war field

And then when allocating :

BitmapFactory.Options options=new BitmapFactory.Options();
byte[] tempBuffer=new byte[8000];//Same here, Greg's style :D I
thought it was suppose to limit the size of the allocation
options.inTempStorage = tempBuffer;//but alone it kept throwing
exception anyway
options.inSampleSize=2;//This divides the size by two before
allocating, works well and doesn't degrade too much the picture
previewBitmap=BitmapFactory.decodeStream(fileInputStream, null,
options);

My two cents.

Yahel

-- 
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