Today I learned about “Android Sharesheet”, simply by adding one line of code to the share intent makes it look nicer.

Line of code:

Intent shareIntent = Intent.createChooser(share, null);

The below code opens the new Android Sharesheet:

* Create simple share intent by simply appending the url to the {
@code shareText}.
public Intent buildShareIntent(String shareText, String url) {
if (StringUtils.isEmpty(shareText) || StringUtils.isEmpty(url)) {
return null;

Intent share = new Intent(Intent.ACTION_SEND);
share.putExtra(Intent.EXTRA_TEXT, shareText + " " + url);
Intent shareIntent = Intent.createChooser(share, null);

return shareIntent;

Thanks for reading!

Google documentation:

software engineer, read, swim, travel. apps:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store