From 70b07471cf555327ba2b9c090dfe08033167ccee Mon Sep 17 00:00:00 2001 From: Tobias Preuss Date: Thu, 16 Dec 2021 23:13:18 +0100 Subject: [PATCH] Use ShareCompat.IntentBuilder in "shareText()" utility function. Signed-off-by: Tobias Preuss --- .../im/vector/app/core/utils/ExternalApplicationsUtil.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vector/src/main/java/im/vector/app/core/utils/ExternalApplicationsUtil.kt b/vector/src/main/java/im/vector/app/core/utils/ExternalApplicationsUtil.kt index 818482043f..8185808484 100644 --- a/vector/src/main/java/im/vector/app/core/utils/ExternalApplicationsUtil.kt +++ b/vector/src/main/java/im/vector/app/core/utils/ExternalApplicationsUtil.kt @@ -314,10 +314,10 @@ fun shareMedia(context: Context, file: File, mediaMimeType: String?) { } fun shareText(context: Context, text: String) { - val sendIntent = Intent() - sendIntent.action = Intent.ACTION_SEND - sendIntent.type = "text/plain" - sendIntent.putExtra(Intent.EXTRA_TEXT, text) + val sendIntent = ShareCompat.IntentBuilder(context) + .setType("text/plain") + .setText(text) + .intent sendShareIntent(context, sendIntent) }