Using Intent.ACTION_SEND to share plain text or image. Everything works fine, the third party apps bottom sheet opens and I choose the sms application but I am not able to pass in the contact number in the intent. If I use share.putExtra("address", "9839098390")
the message body becomes blank, and without using this flag everything works fine except the number recipient field is empty.
I have tried share.putExtra("address", "smsto:9839098390")
and share.putExtra("mmsto:address", "9839098390")
in both these cases the recipient field is filled with "9839060055" but the message body becomes empty.
Here's the code
Intent share = new Intent(Intent.ACTION_SEND);
share.putExtra(Intent.EXTRA_TEXT, message);
share.setType("text/plain");
if (contentUri != null && MIME_TYPE != null) {
share.putExtra(Intent.EXTRA_STREAM, contentUri);
share.setType(MIME_TYPE);
}
if(phoneContact != null && !TextUtils.isEmpty(phoneContact.getId()))
share.putExtra("address", phoneContact.getId());
share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
mContext.startActivity(Intent.createChooser(share, title));