I’d like to share a photo with caption pre-filled from my app via a share intent, on facebook.
I know how to share photo or how to share text, but how do I share them together?
Example code
Intent shareCaptionIntent = new Intent(Intent.ACTION_SEND);
shareCaptionIntent.setType("image/*");
//set photo
shareCaptionIntent.setData(examplePhoto);
shareCaptionIntent.putExtra(Intent.EXTRA_STREAM, examplePhoto);
//set caption
shareCaptionIntent.putExtra(Intent.EXTRA_TEXT, "example caption");
shareCaptionIntent.putExtra(Intent.EXTRA_SUBJECT, "example caption");
startActivity(Intent.createChooser(shareCaptionIntent,getString(R.string.share)));
If a set type to image/* then a photo is uploaded without the caption prefilled. If a set it to text/plain only the caption is uploaded without the photo…..
My guess is that the issue is that the Android Facebook App doesn’t look for Intent.EXTRA_TEXT when it filters an ACTION_SEND Intent with type image/* for photo uploading. So this issue could be resolved if the Android Facebook App looked for that value, and if present, inserted it as the caption of the image.

Add this line to your existing codes:
There is no clearly defined differences among EXTRA_TITLE, EXTRA_SUBJECT and EXTRA_TEXT. So there is no clear share protocol. We could always try them all. 🙂