Skip to content

Instantly share code, notes, and snippets.

@fnzainal
Created November 21, 2016 07:36
Show Gist options
  • Save fnzainal/9456b7e0b0825d388dabe8977cac7eec to your computer and use it in GitHub Desktop.
Save fnzainal/9456b7e0b0825d388dabe8977cac7eec to your computer and use it in GitHub Desktop.
intent to share text on android.
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
String shareBody = "The lorem ipsum content.";
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "subject");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
startActivity(Intent.createChooser(sharingIntent, "Share Title"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment