android bitmap内存储器溢出

android bitmap内存溢出BitmapFactory.Options opts new BitmapFactory.Options()opts.inJustDecodeBou

android bitmap内存溢出

BitmapFactory.Options opts = new BitmapFactory.Options();opts.inJustDecodeBounds = true;BitmapFactory.decodeFile(imageFile, opts);             opts.inSampleSize = computeSampleSize(opts, -1, 128*128);      opts.inJustDecodeBounds = false;try {    Bitmap bmp = BitmapFactory.decodeFile(imageFile, opts);    imageView.setImageBitmap(bmp);    } catch (OutOfMemoryError err) {    }

?另外,可以通过Bitmap.recycle()方法来释放位图所占的空间,当然前提是位图没有被使用。

?

?

转载 http://www.cnblogs.com/RayLee/archive/2010/11/09/1872856.html