takepicture hangs on Android 2.3.3

后端 未结 5 1707
感动是毒
感动是毒 2020-12-28 21:33

I have some codes of taking picture which works in Android 2.1 and 2.2. But these codes broke at Android 2.3. After spending time to fix this issue which went in vain, I wou

5条回答
  •  臣服心动
    2020-12-28 22:32

    The problem lie in the fact that below codes are writen.

    1. There is a PreviewCallback defined,

      PreviewCallback mPreviewCallback = new PreviewCallback() {
      
          @Override
              public void onPreviewFrame(byte[] data, Camera camera) {
                  //Log.i(TAG+".mPreviewCallback.onPreviewFrame", "being called!");
              }
      };
      
    2. mCamera.setPreviewCallback(mPreviewCallback);

    3. mCamera.takePicture()

    That works in 2.1/2.2, but not in 2.3.

    Not sure if Android team supported this way of using camera. If the above flow is expected, then Android team should fix this problem.

提交回复
热议问题