https://kotlinlang.org logo
#android
Title
# android
i

Isaac

06/24/2020, 2:24 PM
Hello. I am trying to get the full path of an image selected from gallery while following Scoped Storage rules, but I'm struggling with it. Can anyone help?
i

Ian Lake

06/24/2020, 3:23 PM
That will never work: you do not have access to the actual File itself. You should be using ContentResolver.openInputStream, etc. to access the file's content
☝️ 1
i

Isaac

06/24/2020, 9:09 PM
Thank you Ian, I used a cursor to get the file.
i

Ian Lake

06/24/2020, 10:40 PM
That won't work for many Uris. Say, a file selected from Google Drive. Please don't ever assume there's even a file
i

Isaac

06/25/2020, 9:38 AM
Okay, that's interesting. I'll look into using a ContentResolver for this. Thanks