Before Android Q, it was always possible to set which items to show on the sharing dialog, and in which order. I even wrote about it here.
For e
Let me see if I can answer some of your questions.
On the native share UI, Is there any way to set which items to show, each with its own Intent, and in which order?
You can use what you're using now, but, as you discovered, it's only possible to provide 2 intents to specifically promote to the top. That said, the change to get the system to populate the rest of the list in alpha order is small:
val chooserIntent = Intent.createChooser(
when {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q -> intent
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M -> Intent()
else -> targetIntents.removeAt(0)
}, chooserTitle
)
This actually looks like what you were doing according to the bug report.
Unfortunately, it's not possible to change the title from "Share" when using Intent.ACTION_SEND
or Intent.ACTION_SEND_MULTIPLE
.
Seeing that there is EXTRA_CHOOSER_TARGETS, does it mean I can get the direct-share items myself?
No. It's provided so that your app can surface its own direct share targets that are appropriate for the action being taken. (source)