简体   繁体   中英

How to get the captured / saved image from camera to another app?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM