Android Tips
- July 14th, 2010
- Posted in android
- Write comment
If you’re still getting “out of memory” you should do something like that:
BitmapFactory.Options options=new BitmapFactory.Options(); options.inSampleSize = 8; Bitmap preview_bitmap=BitmapFactory.decodeStream(is,null,options);
This inSampleSize option reduces memory usage.
BitmapFactory.Options options = new BitmapFactory.Options(); options.inTempStorage = new byte[16*1024]; bitmapImage = BitmapFactory.decodeFile(path,opt);