From d14b747ff114da03f0be352169bf8c07f992669e Mon Sep 17 00:00:00 2001 From: William Brawner Date: Wed, 4 Sep 2024 20:00:45 -0600 Subject: [PATCH] Explicitly set mime type when sharing PDFs --- app/src/main/java/com/wbrawner/skerge/PdfUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/wbrawner/skerge/PdfUtils.kt b/app/src/main/java/com/wbrawner/skerge/PdfUtils.kt index 51f1568..a6a456d 100644 --- a/app/src/main/java/com/wbrawner/skerge/PdfUtils.kt +++ b/app/src/main/java/com/wbrawner/skerge/PdfUtils.kt @@ -41,7 +41,7 @@ fun File.buildShareIntent(context: Context): Intent = "com.wbrawner.skerge.pdfprovider", this@buildShareIntent ) - data = uri + setDataAndTypeAndNormalize(uri, "application/pdf") putExtra(Intent.EXTRA_STREAM, uri) addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) }, name)