I am trying to create an application that takes photos and processes them later. So far, I have managed to access the camera, deliver a preview and take a picture. However, after I take the picture, I cannot resume the preview to take more photos. It just blocks, and if I try to use Camera.stopPreview and then Camera.startPreview to "restart" my preview, I get the following error:
05-05 21:19: 24.316: E / AndroidRuntime (1103): java.lang.RuntimeException: startPreview failed 05-05 21:19: 24.316: E / AndroidRuntime (1103): on android.hardware.Camera.startPreview ( own method)
I need to reset to take some photos. If I comment and did not ruin the preview (one-time photo), the application works.
After extensive hours of research, I cannot find a solution.
Here is my code: http://pastebin.com/dJELpsWN
[LATER EDIT]
A few minutes after I asked the question, I found that the problem was that I was calling Camera.startPreview too quickly until he had time to save / process the photo.
source
share