title: Android Camera: Get Picture Uri after the photo is taken
body: <p>I need to get the File path Uri of the image after the user takes a photo using SurfaceView in Android. I need this so that I can display the image in another view.</p>
  
  <p>Here's my current code:</p>
  
  <pre><code>captureImage.setOnClickListener(new OnClickListener() {
           @Override
              public void onClick(View v) {
                  mCamera.takePicture(null, null, jpegCallback);
           }
  });
  
          mSurfaceView.getHolder().addCallback(this);
          mSurfaceView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
  
          mCamera = Camera.open();
  
  
          jpegCallback = new PictureCallback() {
              public void onPictureTaken(byte[] data, Camera camera) {
  
                  try {
  
                      Intent i = new Intent(CameraActivity.this, ImageEditor.class);
                      //i.putExtra("image", I_need_to_send_the_Uri);
                      startActivityForResult(i, 0);
  
                  } catch (Exception e) {
                       e.printStackTrace();
                  }
              }
          };
  
      }
  
  
  @Override
      public void surfaceCreated(SurfaceHolder holder) {
          try {
              mCamera.setPreviewDisplay(mSurfaceView.getHolder());
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  
      @Override
      public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
          Camera.Parameters params = mCamera.getParameters();
          List&lt;Camera.Size&gt; sizes = params.getSupportedPreviewSizes();
          Camera.Size selected = sizes.get(0);
          params.setPreviewSize(selected.width, selected.height);
          mCamera.setParameters(params);
  
          mCamera.setDisplayOrientation(90);
          mCamera.startPreview();
  
      }
  </code></pre>
  
  <p>How do I get the Image Uri from it? Or what other method do you suggest to open the image in another view? I tried sending the byte[] array and the bitmap but it's way too heavy to be transferred between views and that's bad practice. Help out if you can :)</p>