Rework the custom targets sharesheet snippet - #1063
Open
hamen wants to merge 2 commits into
Open
Conversation
|
Here is the summary of changes. You are about to add 1 region tag.
You are about to delete 1 region tag.
This comment is generated by snippet-bot.
|
kkuan2011
approved these changes
Sep 3, 2026
alabiaga
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reworks the
android_provide_custom_targetssnippet used by the "Add custom targets" section of https://developer.android.com/develop/ui/compose/sharing/send#adding-custom-targets.The snippet on the page builds two
ChooserTargetinstances and passes them throughEXTRA_CHOOSER_TARGETS.ChooserTargethas been deprecated since API level 30, and its documentation points to Direct Share targets instead. The section it illustrates is aboutEXTRA_INITIAL_INTENTS, so theChooserTargetpart was not needed to make the point.What changed:
ChooserTargetinstances and theEXTRA_CHOOSER_TARGETSextra, along with the now unusedChooserTargetimport.Intent.createChoosercall. The old code wrapped an already-created chooser in a second chooser, which is not what the guide describes.CustomActivity) rather than pointing at Nearby Share and Maps.This deviates from the current page text, which still shows the
ChooserTargetversion. The page needs the same update.