android--zxing返回扫描界面出现黑屏的解决方案

修改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);//此处为新增方法
		}
	}


你可能感兴趣的:(android开发,/,jni)