bit地图 内存溢出OOM的解决方法分享
bitmap 内存溢出OOM的解决办法分享BitmapFactory.Options bitmapOptions new BitmapFactory.Options()b
bitmap 内存溢出OOM的解决办法分享
BitmapFactory.Options bitmapOptions = new BitmapFactory.Options(); bitmapOptions.inSampleSize = 4; bitmap = BitmapFactory.decodeStream(this.getContentResolver()..openInputStream(uri), null , bitmapOptions);
if (bitmap != null && !bitmap.isRecycled()) bitmap.recycle(); // Eliminate extra GCs during startup by setting the initial heap size to 4MB. // TODO: We should restore the old heap size once the activity reaches the idle state VMRuntime.getRuntime().setMinimumHeapSize(INITIAL_HEAP_SIZE);