二维码扫描退出时偶尔出现黑屏

minjasmine 发布于 2014/06/26 09:40
阅读 273
收藏 0

您好,想跟你请教个问题:二维码在扫描界面点击返回时,有时会出现黑屏,然后相机就不能使用,跟踪代码后发现下面代码中 camera.stopPreview();运行卡住了,不知道怎么解决了

public synchronized void stopPreview() {
 StoreLog.e("zpy", "stopPreview 0");
    if (autoFocusManager != null) {
    StoreLog.e("zpy", "stopPreview1");
      autoFocusManager.stop();
      StoreLog.e("zpy", "stopPreview 2");
      autoFocusManager = null;
    }
    if (camera != null && previewing) {
       StoreLog.e("zpy", "stopPreview 3");
      camera.stopPreview();
      StoreLog.e("zpy", "stopPreview 4");
      previewCallback.setHandler(null, 0);
      StoreLog.e("zpy", "stopPreview 5");
      previewing = false;
    }
  }


加载中
返回顶部
顶部