首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

bit地图 内存溢出OOM的解决方法分享

2012-09-25 
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);


 

热点排行