I am having trouble getting the absolute file from a URI on my devices.
I am using the getPath method from here https://stackoverflow.com/a/20559175/765269
The Problem is: The returned path is something like /storage/emulated/0/DCIM.. (for the Gallery).
This path does neither exist on my Nexus 4 (Android L) nor my Photon Q (Android 4.4.4).
/storage/emulated/legacy/DCIM.. would be correct (the directory 0 does not exist).
root@mako:/storage/emulated # ls -al
lrwxrwxrwx root     root              2014-10-04 05:35 legacy -> /mnt/shell/emulated/0
My application registers as a share receiver, then uses the extra_stream parameter to obtain the URI(s). Sharing a picture to the Gmail application works fine, so there must be a way..
Edit: If you substitute the 0 with legacy, the paths are correct.
 
    