I'm using the code below to share Image and text in Android. When I choose Whatsapp it shares the image and text together , but when I choose Facebook it just shares Image without any text! What's mistake in my code? Thanks.
Intent share = new Intent(Intent.ACTION_SEND);
share.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(bitmapPath)));
share.putExtra(Intent.EXTRA_TEXT, "Shared via" + APP_URL);
startActivity(Intent.createChooser(share, "Share Image"));
What's wrong in my code?
ACTION_SEND supports either
EXTRA_STREAM in one
Intent, not both ("...can have either a EXTRA_TEXT or EXTRA_STREAM field, containing the data to be sent"). Some
ACTION_SEND implementations will go beyond the documented protocol and try to use both. Others will stick with the documented protocol and only use one. In this case, Facebook perhaps chose to stick with the documented protocol and only use one.