I am using LauncherForActivityResult to pick a fil...
# compose-android
s
I am using LauncherForActivityResult to pick a file from my device and it's not showing the file name, is there a way i can get the file name from the API?
Copy code
val openDocument = rememberLauncherForActivityResult(
    contract = ActivityResultContracts.OpenDocument()
) { uris ->
    if (uris != null) {
        selectDocument(uris)
    }
}
ChatAttachmentOptions(
    title = "Document",
    icon = R.drawable.document_cliqbox,
    onClick = {
        openDocument.launch(arrayOf("application/pdf"))
    }
)
c
Your question is not really Compose related but you will need a content resolver to query the meta data. https://developer.android.com/training/data-storage/shared/documents-files#examine-metadata