I use the following code to share an image and text through WhatsApp. It only shares the image, not the text, however. I have searched all over the Internet, but haven't found a solution.
String message = Fname + Mobileno + Homeno + Workmail + Homemail
+ Gtalk + Skype + Address + Company + Title + Website;
Intent shareIntent = new Intent(Intent.ACTION_SEND);
Uri uri = Uri.parse("file://"
+ Environment.getExternalStorageDirectory()
+ "/Talk&Share/Images/profpic.png");
shareIntent.putExtra(Intent.EXTRA_TEXT, message);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Contact");
if(uri != null){
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
shareIntent.setType("image/plain");
}else{
shareIntent.setType("plain/text");
}
return shareIntent;
Whatsapp Support Image sharing along with text.
This will share image and EXTRA_TEXT will consider as image caption.
Use:
instead of:
This is not possible, as WhatsApp does not support messages with both pictures and text in them. A message may consist of a single image, text sequence, audio file, contact or video. You cannot have a combination of any of those.