Hi I want to show 3 or 4 image in my view that are stored in sdcard the size of images is 1-2 MB approximately.
My problem is when I use image in imageview then it throw out of memory exception
i have create bit and pass option when decoding image to bitmap
02-26 13:16:54.946: ERROR/dalvikvm-heap(23410): 15980544-byte external allocation too large for this process.
02-26 13:16:54.946: ERROR/dalvikvm(23410): Out of memory: Heap Size=3407KB, Allocated=2801KB, Bitmap Size=15630KB, Limit=21884KB
02-26 13:16:54.946: ERROR/dalvikvm(23410): Trim info: Footprint=3463KB, Allowed Footprint=3655KB, Trimmed=248KB
02-26 13:16:54.946: ERROR/GraphicsJNI(23410): VM won't let us allocate 15980544 bytes
02-26 13:16:54.986: ERROR/AndroidRuntime(23410): FATAL EXCEPTION: main
02-26 13:16:54.986: ERROR/AndroidRuntime(23410): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
02-26 13:16:54.986: ERROR/AndroidRuntime(23410): at android.graphics.BitmapFactory.nativeDecodeFile(Native Method)
02-26 13:16:54.986: ERROR/AndroidRuntime(23410): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:325)
can any body help me in solving my problem
thanks in advance
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…