-
-
Save 5AbhishekSaxena/1e55a4bed7619bb811303376cbcfbdde to your computer and use it in GitHub Desktop.
Sms sharing intent type
This file contains 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
class SmsSharingIntent( | |
private val sms: Sms, | |
chooserTitle: String = "Please select app to send SMS with", | |
) : SharingIntent { | |
override val intentChooserTitle: String = chooserTitle | |
override fun prepareIntent(): Intent = Intent().apply { | |
action = Intent.ACTION_VIEW | |
data = Uri.parse("sms: ${sms.phoneNumber}") | |
putExtra("sms_body", sms.body) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment