Created
August 11, 2015 09:35
-
-
Save asanand3/2e2c5851817833885454 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); | |
shareIntent.setType("image/jpeg"); | |
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Hi"); //set your subject | |
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "How are you"); //set your message | |
String imagePath = Environment.getExternalStorageDirectory() + File.separator + "test.jpg"; | |
File imageFileToShare = new File(imagePath); | |
Uri uri = Uri.fromFile(imageFileToShare); | |
shareIntent.putExtra(Intent.EXTRA_STREAM, uri); | |
startActivity(Intent.createChooser(shareIntent, "Share Image")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment