1

I've created an SMS Intent, to compose a message to multiple recipients.

String recipients = "smsto:1111;2222;3333"
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse(recipients));
intent.putExtra("sms_body", message);
intent.putExtra("compose_mode", true);

The problem is, not all devices/apps seem to use semicolon(;) as the recipient separator.

For example, on Sony Experia Z1/Z2, the recipients are separated with a comma(,).
When the Intent is launched on those devices, all the numbers in my Uri is merged to just one recipient. As a result, the message is only sent to the first number (1111).

Is there a better way of adding multiple recipients to this Intent?

KvTvK
  • 106
  • 4
  • You could lopp through an array of the strings creating a new intent for each one using a for loop – yampelo May 30 '14 at 15:48
  • Thanks Omer, but this will launch the composer multiple times. What if there is 20 recipient? I can not expect my users to press send separately for each one. – KvTvK May 30 '14 at 16:03
  • I thought you were sending the messages without any user - interaction – yampelo May 30 '14 at 16:41

0 Answers0