Skip to content

Instantly share code, notes, and snippets.

@Binary-Finery
Created September 8, 2018 20:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Binary-Finery/0ae4bc4c0fd14c04ab4f9229f7ee87fa to your computer and use it in GitHub Desktop.
Save Binary-Finery/0ae4bc4c0fd14c04ab4f9229f7ee87fa to your computer and use it in GitHub Desktop.
Share bitmap image via intent
private void sharePalette(Bitmap bitmap) {
String bitmapPath = MediaStore.Images.Media.insertImage(getContentResolver(), bitmap, "palette", "share palette");
Uri bitmapUri = Uri.parse(bitmapPath);
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/png");
intent.putExtra(Intent.EXTRA_STREAM, bitmapUri);
startActivity(Intent.createChooser(intent, "Share"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment