So in creating a photo portion of my app, where the user can either take a picture or choose a picture from the gallery, I am encountering some weird problems.
The "take picture" implementation relied on absolute filepaths to the cache directory in the system as given by getExternalCacheDir()
, so manipulating these files is done with Strings that delineate the location of the image files.
However when I try to get a picture from the Gallery instead, using an Intent getting MediaStore.Images.Media.EXTERNAL_CONTENT_URI
, the corresponding image is in the form of a Uri
.
For the sake of consistency I tried to convert this Uri
into a path by doing .getPath()
but this only gave me the folder containing the image and not the full path to the actual image.
How do I get the full path to the image given to me from the gallery Intent so I can work purely in terms of filepaths?