I call startActivityForResult with Intent ACTION_GET_CONTENT. Some app returns me data with this Uri:
content://media/external/images/media/18122
I
To get filename, you can use new DocumentFile format.
DocumentFile documentFile = DocumentFile.fromSingleUri(this, data.getdata()); String fileName = documentFile.getName();