标签:
修改CameraManager类中的openDriver(SurfaceHolder holder)方法:
public void openDriver(SurfaceHolder holder) throws IOException { if (camera == null) { System.out.println("wanggsx openDriver camera = null"); camera = Camera.open(); if (camera == null) { throw new IOException(); } camera.setPreviewDisplay(holder); if (!initialized) { initialized = true; configManager.initFromCameraParameters(camera); } configManager.setDesiredCameraParameters(camera); FlashlightManager.enableFlashlight(); } else { System.out.println("wanggsx openDriver camera != null"); camera.setPreviewDisplay(holder);//此处为新增方法 } }
标签:
原文地址:http://blog.csdn.net/wanggsx918/article/details/43564645