Search code examples
androidmms

Sending MMS does include the "sms_body"


I am trying to send an image via an MMS using the following code

Intent sendIntent = new Intent(Intent.ACTION_SEND); 
sendIntent.putExtra("sms_body", "Hi there"); 
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
sendIntent.setType("image/png"); 

It opens the Messaging apps and attach the message but it did not write the "sms_body" which is in my case "Hi there". Why?


Solution

  • try this:

    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
    intent.putExtra("subject", "subject");
    intent.putExtra("sms_body", "Hi there");
    intent.putExtra("address", "Phonenumber");
    intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
    intent.setType("image/png");
    startActivity(intent);