public class CameraView extends SurfaceView implements SurfaceHolder.Callback, PictureCallback { public void onPictureTaken(byte[] datas, Camera camera) { Bitmap bitmap = BitmapFactory.decodeByteArray(datas, 0, datas.length); // OutOfMemoryErrorログを見るとこんなことを言われてしまってた。
java.lang.OutOfMemoryError: bitmap size exceeds VM budget対処方法はこれ。
BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 2; Bitmap bitmap = BitmapFactory.decodeByteArray(datas, 0, datas.length, options);see also:
http://developer.android.com/intl/ja/reference/android/graphics/BitmapFactory.Options.html
http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue