3

The question is (might be a repeated one), but I could not find a proper answer to it, so asking here again.
In my application, I need to share both an image and a text file using a single intent.
I read a few answers, like:
ACTION_SEND sending both an Image and Text in the same Intent,
Send Image and Text both using ACTION_SEND or ACTION_SEND_MULTIPLE
and also Problems sharing combined text and image with SHARE INTENT

and tried to implement the given solutions in my application, but none of them worked for me.

The code I've implemented so far is as below :

Intent share = new Intent(Intent.ACTION_SEND);
        share.putExtra(Intent.EXTRA_SUBJECT, "I found movie "+movieTitle+" on Movies Tracker!");
        share.putExtra(Intent.EXTRA_TEXT, "my text");
        share.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
        share.setType("image/*");
        share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
        startActivity(Intent.createChooser(share, "Share via"));

So now my question is: is there any way to share both an image and a text file with single intent?
If it's possible, then please help regarding this issue.
Thanks in advance.

Community
  • 1
  • 1
AndyN
  • 1,742
  • 1
  • 15
  • 30
  • Intent sharingIntent = new Intent(Intent.ACTION_SEND); Uri screenshotUri = Uri.parse("file:///sdcard/image.jpg"); sharingIntent.setType("image/*"); sharingIntent.putExtra(Intent.EXTRA_TEXT, "Body text of the new status"); sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri); startActivity(Intent.createChooser(sharingIntent, "Share image using")); – Digvesh Patel Jan 29 '14 at 12:44
  • How exactly you need to send image i.e from drawable folder or from sdcard ? – AndroidHacker Jan 29 '14 at 12:52

0 Answers0