Zxing扫描二维码返回键黑屏处理c

修改CameraManager中closeDriver()方法

public void closeDriver() {
		if (camera != null) {
			FlashlightManager.disableFlashlight();
			//注意该处
			if (previewing){
				camera.stopPreview();
			}
			camera.release();
			camera=null;
			previewing=false;
		}
	}
设置可以重复扫描
inactivityTimer.onActivity();
		playBeepSoundAndVibrate();
          //添加代码块实现重复扫描
		mHandler.postDelayed(new Runnable() {
			public void run() {
				initCamera(surfaceHolder);
				if (handler != null) {
				//重启扫描仪
					handler.restartPreviewAndDecode();
				}
				CameraManager.get().closeDriver();
			}
		},1500);
		String resultString = result.trim();

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