Out of Memory Bitmap Android -
Out of Memory Bitmap Android -
i used volley library , got error. used listview display. application doesn't stop if don't scroll downwards list view.
i have read threads "oom" in stackoverflow. didn't find useful. application gets json string base of operations 64 encoded image web. decode string byte array , decode via bitmapfactory. display bitmap.
if want display multiple bitmap in 1 activity should display thumbnails of these bitmaps in order avoid out of memory error. :
bitmap getthumbnailfrombitmap(bitmap) { int width = bitmap.getwidth(); int height = bitmap.getheight(); int max = math.max(width, height); if (max>512) { int thumbwidth = math.round((512f/max)* width); int thumbheight = math.round((512f/max)* height); bitmap thumbnail = thumbnailutils.extractthumbnail(bitmap, thumbwidth , thumbheight); bitamp.recycle(); homecoming thumbnail ; } else { homecoming bitmap ; } }
android bitmap
Comments
Post a Comment