0

I have a camera app that allows the user to "Save" or "Discard" image after each photo is taken. If "Save" is clicked the app goes back to the MainActivity (camera preview) and keeps the photo. If "Discard" is clicked the photo is removed and goes back to the MainActivity (camera preview). This all works fine.

I have a standard email app (TypeApp) that allows users to attach a photo by "Take a Picture" function which when clicked shows all installed camera. I want to use my camera app to allow this but when I save the photo and click "Back" no image is attached. I've seen it worked on other camera app but I don't know how to begin to implement this feature in my app.

How do I get my camera app to send back the location of the image to the standard email app when the user clicks the "Save" button.

Any guidance would be appreciated.

moe
  • 167
  • 3
  • 13

1 Answers1

0

Please try this, maybe you'll get data in the third parameter.

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
    {
    //you get data in  email app (TypeApp) Activity
    }
}//onActivityResult

Useful link:- https://developer.android.com/training/basics/intents/result

More HelpFull:- https://medium.com/@rodrigolmti/android-get-camera-thumbnail-and-full-image-1bddfdc5347e

Hitesh Anshani
  • 1,499
  • 9
  • 19
  • Thank you for your answer. All the examples that I have seen with the `onActivityResult` displays the captured image in an `ImageView` within the same camera app. How do I use the `onActivityResult` to `return` the image `URI` to the email app and my camera app to close? – moe Jun 19 '18 at 11:06
  • When you trigger intent to open the application its open at that time your activity is in pause and once you come back in an email app activity resume and its come on an activity result and that time you can check whether the captured image is coming or not @moe – Hitesh Anshani Jun 19 '18 at 11:10
  • I don't have access to the email app's source. It could be any app that allows users to attach images using a camera @D-john Anshani – moe Jun 19 '18 at 11:20
  • Its handle internally I guess because when I have created an application which picks images from gallery and it shows data in on activity result.@moe – Hitesh Anshani Jun 19 '18 at 11:37
  • For information refer last answer of this link https://stackoverflow.com/questions/26457469/sending-command-to-the-in-built-camera-app – Hitesh Anshani Jun 19 '18 at 11:39
  • Hi. I have even tried it with the google sample https://github.com/google/cameraview/tree/master/demo/src/main but I still can't get it to work. – moe Jun 19 '18 at 11:59
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/173394/discussion-between-d-john-anshani-and-moe). – Hitesh Anshani Jun 19 '18 at 12:02