Tell me, who knows, I can not figure out what's wrong. When you press the camera button, an event occurs:
private void takePicture() { camera.takePicture(shutterCallback, null, null, jpegCallback); shutterCallback = new ShutterCallback() { public void onShutter() { camera.startPreview(); } }; // запись файла jpegCallback = new PictureCallback() { public void onPictureTaken(byte[] data, Camera camera) { if (data != null) { mydata = data; done(); // сохранение изображения camera.startPreview(); } } }; }
An image appears on the screen, but it is not saved and startPreview
does not work. Only after the second button press, the image is saved and the prewiew
works prewiew
.