surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
SDK上貌似说会自动设置, 不用特意调用这个方法了。但我不调用它,预览就显示不了了。不知是不是设置成了这个Type就不能按常规那样在Canvas上画布了,也不知这个Type是不是此后者不能再修改了。
我是想拍照后,stopPreview() ,然后把拍的照片直接显示在预览用的SurfaceView上
但Canvas canvas = surfaceHolder.lockCanvas();总是失败的。04-12 12:09:21.917: ERROR/Surface(6123): Surface (identity=2206) requestBuffer(0, 00000033) returneda buffer with a null handle04-12 12:09:21.917: ERROR/Surface(6123): getBufferLocked(0, 00000033) failed (Out of memory)04-12 12:09:21.917: ERROR/Surface(6123): dequeueBuffer failed (Out of memory)04-12 12:09:21.964: ERROR/SurfaceHolder(6123): Exception locking surface04-12 12:09:21.964: ERROR/SurfaceHolder(6123): android.view.Surface$OutOfResourcesException