Skip to content

Instantly share code, notes, and snippets.

@sudar
Created January 26, 2011 16:30
Show Gist options
  • Save sudar/796953 to your computer and use it in GitHub Desktop.
Save sudar/796953 to your computer and use it in GitHub Desktop.
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
Uri screenshotUri = Uri.parse(path);
sharingIntent.setType("image/png");
sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
startActivity(Intent.createChooser(sharingIntent, "Share image using"));
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("text/html");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml("<p>This is the text that will be shared.</p>"));
startActivity(Intent.createChooser(sharingIntent,"Share using"));
@snehasis783
Copy link

But in case of Facebook populated string does not work as status update value. How to work it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment