0

I have following code, which invoke mms client and attaches to it a picture

    Intent sendIntent = new Intent(Intent.ACTION_SEND); 
    sendIntent.putExtra("sms_body", "some text"); 
    sendIntent.putExtra("address", phoneNumber);
    sendIntent.putExtra(Intent.EXTRA_STREAM, mCurrItemUri);
    sendIntent.setType("image/*");
    getContext().startActivity(
            Intent.createChooser(sendIntent, "Send MMS..."));

The problem I am facing is that I cannot pass phone number to that intent. And Is there any way to pass an array of phone numbers to it?

Thank you on advance.

unresolved_external
  • 1,930
  • 5
  • 30
  • 65

1 Answers1

0

I think you need to set proper type for mms. for example:

Intent sendIntent = new Intent(Intent.ACTION_VIEW);
sendIntent.setType("vnd.android-dir/mms-sms");
...
...

For more info, read this.

waqaslam
  • 67,549
  • 16
  • 165
  • 178
  • 1
    if I do it like this I wont be able to attach a photo. Can you please tell me how to attach a photo when sms client is invoked like this? – unresolved_external May 17 '12 at 07:09
  • to attach images you need to work with `Uri`. For more info, read [this](http://stackoverflow.com/a/4991812/966550) – waqaslam May 17 '12 at 15:06
  • thanks, for your answer, I already managed that. Could you please comment on this question - http://stackoverflow.com/questions/10634357/how-to-send-mms-to-several-numbers-in-android ? – unresolved_external May 17 '12 at 15:09