fix: add ClipData for Android 10+ share sheet image preview#121
Merged
Choochmeque merged 1 commit intoChoochmeque:mainfrom Mar 14, 2026
Merged
Conversation
Android 10+ requires ClipData to be set on the share Intent for the native share sheet to render an image thumbnail. Without it the sheet opens but shows no preview image.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Android share plugin to improve share sheet UX when sharing files by enabling thumbnail previews via ClipData.
Changes:
- Add
ClipDatato the file-sharing intent so Android’s share sheet can display a preview thumbnail (esp. on Android 10+). - Add the required
ClipDataimport.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
6
to
7
| import android.content.pm.PackageManager | ||
| import android.os.Build |
Owner
|
Merged. Thank you! |
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.
Android 10+ (API 29+) requires
ClipDatato be set on the shareIntentfor the native share sheet to render an image thumbnail. Without it, the share sheet opens correctly but shows no preview image.Root cause: Android's share sheet on API 29+ ignores
EXTRA_STREAMfor thumbnail rendering unless a matchingClipDatais also attached to theIntent.Fix: Set
clipDataon the intent with the same URI and MIME type that is already passed viaEXTRA_STREAM:Tested on Android 13 (API 33). Share sheet now shows the image thumbnail as expected.