-
-
Save 5AbhishekSaxena/b75d8df7f784d940b330a9a7f26084db to your computer and use it in GitHub Desktop.
Web URL sharing intent
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 WebBrowserSharingIntent( | |
private val url: String, | |
chooserTitle: String = "Please select the web browser", | |
) : SharingIntent { | |
override val intentChooserTitle: String = chooserTitle | |
override fun prepareIntent(): Intent { | |
return Intent().apply { | |
action = Intent.ACTION_VIEW | |
data = url.toUri() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment