val url = "https://www.travelopy.com"ShareCompat.IntentBuilder .from(activity) .setType("text/plain") .setChooserTitle("Share URL") .setText(url) .startChooser()
NOTE: Will always show chooser dialog even default app is selected.
or
val shareIntent = ShareCompat.IntentBuilder .from(activity) .setType("text/plain") .setChooserTitle("Share URL") .setText(url) .intentif (shareIntent.resolveActivity(activity.packageManager) != null) { activity.startActivity(shareIntent)}
NOTE: Will not show chooser dialog if default app is selected.