Share image and text through whatsapp

后端 未结 4 2209
甜味超标
甜味超标 2020-12-06 20:04

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 fo

相关标签:
4条回答
  • 2020-12-06 20:15

    Use:

    Intent.ACTION_SEND_MULTIPLE
    

    instead of:

    Intent.ACTION_SEND
    
    0 讨论(0)
  • 2020-12-06 20:17

    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.

    0 讨论(0)
  • 2020-12-06 20:22

    Whatsapp Support Image sharing along with text.

    Intent shareIntent = new Intent();
    shareIntent.setAction(Intent.ACTION_SEND);
    shareIntent.putExtra(Intent.EXTRA_TEXT,title + "\n\nLink : " + link );
    shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(imageFilePath));
    shareIntent.setType("image/*");
    startActivity(Intent.createChooser(shareIntent, "Share image via:"));
    

    This will share image and EXTRA_TEXT will consider as image caption.

    0 讨论(0)
  • 2020-12-06 20:31
    Intent i = new Intent(android.content.Intent.ACTION_SEND);
     i.setType("text/plain");
     i.putExtra(Intent.EXTRA_SUBJECT, "Subject");
     i.putExtra(Intent.EXTRA_TEXT, "Message body");
    startActivity(Intent.createChooser(i, "Share dialog title"));
    
    0 讨论(0)
提交回复
热议问题