How To Get Real File Path From Android File
I didn't think this would be such a difficult task to solve but I can't seem to find the answer anywhere. I'm trying to get the file path to an image after a user navigates the fol
Solution 1:
If do you want to display the File Path to the user and it's like a core feature of your app, then I'm really sorry to say that, from API 29 or Android 10 we can't get the actual path of the file dur to some security reasons but if that's not the case then you can do it with
InputStream is = getContentResolver().openInputStream(data.getData());
Then you can get File Name and File Size using Cursor
passing the Intent data and then using OpenableColumns.FILE_NAME
and OpenableColumns.FILE_SIZE
.
Post a Comment for "How To Get Real File Path From Android File"