PictureCallback.onPictureTaken never called

前端 未结 3 1231
别那么骄傲
别那么骄傲 2020-12-10 13:06

I am writing an application that needs pictures taken with the camera. The problem occurs when I try to take an actual picture. Here\'s the code that is troubling me:

<
3条回答
  •  温柔的废话
    2020-12-10 14:06

    I finally went and debugged the problem. All of a sudden it worked, because debugging is much slower: It's a timing problem. The callback takes some time to be called. While debugging the phone had enough time to finish taking the picture ...

    Also don't go calling Camera.stopPreview() and Camera.release() too early.

提交回复
热议问题