-
-
Save 5AbhishekSaxena/969a711c99dd1eca244adb49cc64811a to your computer and use it in GitHub Desktop.
Default 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 DefaultSharingIntent( | |
private val context: Context, | |
private val body: String, | |
chooserTitle: String = "Share using", | |
) : SharingIntent { | |
override val intentChooserTitle: String = chooserTitle | |
override fun prepareIntent(): Intent { | |
return ShareCompat.IntentBuilder(context) | |
.setType("text/plain") | |
.setText(body) | |
.intent | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment