add caption to image on new whatsapp ver 2.11.399

2019-04-07 09:42发布

问题:

Friends,

On android "whatsapp messenger" version 2.11.399 (Sep 30, 2014) it is possible to add a caption (textual decription) to a shared image.

I share image via intent as follows:

Intent share = new Intent(android.content.Intent.ACTION_SEND);
share.setType("image/jpeg");
Uri imageUri = Uri.fromFile(file);
share.putExtra(Intent.EXTRA_STREAM, imageUri);
//share.putExtra(Intent.EXTRA_TEXT, "This is my text to send."); // NOT WORKING
startActivity(share);

How can I add the text to the image caption?

回答1:

@robert I was passing those parameters in older version and it just sending image but when I update my Whats app version with 2.11.432 And now it's showing me both Image and text as caption. I was noticed that In was not showing in 2.11.399 or any older version. Just try to update your whats app and let me know is it works or not!! Your code is right just send one extra text also

share.putExtra(Intent.EXTRA_TEXT,shareBody);
share.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(yourFile));