From aa8394616e7aa7e32411abe856804b0d7321dcdb Mon Sep 17 00:00:00 2001 From: pumpitbetter Date: Fri, 13 Mar 2026 14:22:04 +0000 Subject: [PATCH] fix: add ClipData for Android 10+ share sheet image preview 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. --- android/src/main/java/SharePlugin.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/src/main/java/SharePlugin.kt b/android/src/main/java/SharePlugin.kt index 5666604..24b7535 100644 --- a/android/src/main/java/SharePlugin.kt +++ b/android/src/main/java/SharePlugin.kt @@ -1,6 +1,7 @@ package app.tauri.share import android.app.Activity +import android.content.ClipData import android.content.Intent import android.content.pm.PackageManager import android.os.Build @@ -99,6 +100,9 @@ class SharePlugin(private val activity: Activity): Plugin(activity) { this.putExtra(Intent.EXTRA_TITLE, args.title) } + // Android 10+ requires ClipData so the share sheet can show a preview thumbnail. + sendIntent.clipData = ClipData.newUri(activity.contentResolver, args.title ?: "", contentUri) + val shareIntent = Intent.createChooser(sendIntent, args.title) startActivityForResult(invoke, shareIntent, "shareFileResult") }