Use ShareCompat.IntentBuilder in "shareText()" utility function.
Signed-off-by: Tobias Preuss <tobias.preuss@googlemail.com>
This commit is contained in:
parent
5fd3317197
commit
70b07471cf
|
@ -314,10 +314,10 @@ fun shareMedia(context: Context, file: File, mediaMimeType: String?) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun shareText(context: Context, text: String) {
|
fun shareText(context: Context, text: String) {
|
||||||
val sendIntent = Intent()
|
val sendIntent = ShareCompat.IntentBuilder(context)
|
||||||
sendIntent.action = Intent.ACTION_SEND
|
.setType("text/plain")
|
||||||
sendIntent.type = "text/plain"
|
.setText(text)
|
||||||
sendIntent.putExtra(Intent.EXTRA_TEXT, text)
|
.intent
|
||||||
|
|
||||||
sendShareIntent(context, sendIntent)
|
sendShareIntent(context, sendIntent)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue