[android] How to extract the file name from URI returned from Intent.ACTION_GET_CONTENT?

?????????????

I got some information from the developer's website

????

val cursor = context.contentResolver.query(fileUri, null, null, null, null)

??????????????

val nameIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME)
val sizeIndex = cursor.getColumnIndex(OpenableColumns.SIZE)
cursor.moveToFirst()
val fileName = cursor.getString(nameIndex)
val size = cursor.getLong(sizeIndex)

???????

Don't forget to close resources

Retrieving file information