Before KitKat (or before the new Gallery) the Intent.ACTION_GET_CONTENT
returned a URI like this
content://media/external/images/media/3951.
Using the ContentResolver
and quering for
MediaStore.Images.Media.DATA
returned the file URL.
In KitKat however the Gallery returns a URI (via "Last") like this:
content://com.android.providers.media.documents/document/image:3951
How do I handle this?
Best Answer
This requires no special permissions, and works with the Storage Access Framework, as well as the unofficial
ContentProvider
pattern (file path in_data
field).See an up-to-date version of this method here.