Code example for Camera

Methods: setPreviewDisplay

0
	public void surfaceCreated(SurfaceHolder holder) {
		PreyLogger.i("camera setPreviewDisplay()"); 
		mHolder = holder;
		try { 
			if (camera != null)
				camera.setPreviewDisplay(mHolder);
		} catch (Exception e) {
			PreyLogger.e("Error PreviewDisplay:" + e.getMessage(), e);
		} 
	} 
 
	public void surfaceDestroyed(SurfaceHolder holder) {
		PreyLogger.i("camera surfaceDestroyed()"); 
		if (camera != null) {
			camera.stopPreview();
			camera.release();
			camera = null;
		} 
	} 
 
}