Camera not saving image and drops exception
I'm creating camera app. I'm doing that in fragment. I have FrameLayout where I add the camera, and one button for capture. There are 2 problems. Camera not saves the image. When I click second time on capture image, drops exception java.lang.RuntimeException: takePicture failed I don't know where's the problem, I'm using camera API first time. Camera I'm using only in portrait mode. And in manifests I added the permissions for camera and write external storage. I have one class where I'm extending SurfaceView . Let me show you the code. public class ShowCamera extends SurfaceView implements