Android – how to use bitmaps to avoid memory overload?
•
Android
My application uses bitmaps that display images the second time a user enters a specific activity
Bitmap bm = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory()+"//Pics/"Image.jpg");
I've tried something like
BitmapFactory.Options options = new BitmapFactory.Options();
options.inTempStorage = new byte[16*1024];
I don't know how to set it. But it doesn't help. Once the user leaves this activity, is there a way to clear the bitmap, etc? thank you
resolvent:
When you use the bitmap to release memory, you call Bitmap.recycle ().
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码