title: Android Galaxy S4 camera bug
body: <p>There is a problem with custom camera app and Samsung Galaxy S4 phone. Sometimes, when the app takes picture, the S4 phone can take multiple pictures at once. It happens occasionally same code working for other devices just fine. Here is the code that takes picture:</p>
  
  <pre><code>Parameters params = camera.getParameters();
  params.setRotation(rotation);
  camera.setParameters(params);
  camera.autoFocus(new Camera.AutoFocusCallback() {
  
      @Override
      public void onAutoFocus(boolean success, Camera camera) {
          camera.takePicture(shutterCallback, null, PreviewCallback.this);
      }
  });
  
  @Override
  public void onPictureTaken(byte[] data, Camera camera) {
      pictureCallback.onPictureTaken(previewData, data);
      camera.startPreview();
      Parameters params = camera.getParameters();
      params.setRotation(rotationOrig);
      camera.setParameters(params);
  }
  </code></pre>
  
  <p>Rotation is just for correct exif rotation tags.</p>