I'd like to share an image from my app and customize the caption based on the user's chosen app.
Below code works well, but the text is always the same, no matter which app the user chose.
val sendIntent: Intent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_TEXT, "This is my text to send.")
putExtra(Intent.EXTRA_STREAM, uriToImage)
type = "image/png"
}
val shareIntent = Intent.createChooser(sendIntent, null)
startActivity(shareIntent)
How can I customize the text based on the chosen app?