简体   繁体   中英

Are images taken by launching a camera intent saved to cache?

From the onActivityResult(...) {...} I can get the path to the image taken by launching a camera intent with data.getData() . Is this a cache location or a persistent location? I can't find any documentation on it?

I am going to pass it to the server, but I don't know if I have to delete the image or if I have to copy it another location before doing further things with it?

Good question, I suspect that this might not be the same over all devices and versions. In my experience if you do not specify a location to save the image it saves it to the default camera photos folder, so it does persist (in addition you get back a small bitmap through the onActivityResult). But I am not sure about other devices.

The camera intent has a few inconsistencies overall for example: The size of the bitmap you get back from the camera varies slightly, most devices will save the image in its correct orientation, however some devices (namely a few Samsung devices) will always save the file itself in the same way but will store the proper information inside the EXIF, also on some devices/versions the activity that calls the camera intent will always get destroyed and re-created once the camera is finished regardless of any other factor.

So it might not be something that is universal.

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