I’m using the code below to allow a user to share an image with another app:
val intent: Intent = Intent().apply {
type = "image/jpeg"
if (uris.size == 1) {
action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_STREAM, uris.first())
} else {
action = Intent.ACTION_SEND_MULTIPLE
putParcelableArrayListExtra(Intent.EXTRA_STREAM, ArrayList(uris))
putExtra(Intent.EXTRA_MIME_TYPES, arrayOf(extraMimeTypes))
}
}
val shareIntent = Intent.createChooser(intent, null)
startActivity(shareIntent)
Everything works functionally (i.e. I’m able to share the image via messages or email) except that there is no image or file name shown in the share sheet:
But I would like it to look something like this:
What do I need to do to show the image in the share sheet?