My app can share internally stored files with the androidx.core.content.FileProvider
.
The intent and the chooser are created with the following snippet:
val shareIntent: Intent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(
Intent.EXTRA_STREAM,
FileProvider.getUriForFile(this, authority, file, displayName),
)
type = document.mimeType.mediaType
}
startActivity(Intent.createChooser(shareIntent, getString(R.string.share_title)))
I explicitly pass the displayName
to the FileProvider
, but in the app chooser, I see the file's local name (see image).
Is there a way to show the correct display name in the chooser?