1. Are you ready for the Galaxy S20? Here is everything we know so far!

SMS Intent does not work with contact having number with spaces

Discussion in 'Android Development' started by TienDat, Jan 11, 2021.

  1. TienDat

    TienDat Lurker
    Thread Starter

    Dear all,

    We are using Intent to start an activity on SMS default app of android.
    We noticed that if we send to multiple recipients, the recipient with number having spaces will be dropped.
    If we send to only one recipient, it still works.

    Here is how we build the intent:
    final Uri uri = Uri.parse("smsto:" + stringOfMultipleNumbers);
    Intent smsIntent = new Intent(Intent.ACTION_SENDTO, uri);
    smsIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    smsIntent.putExtra("sms_body", messageContent);

    For instance, stringOfMultipleNumbers is "0123456787;0123456788;01 23 45 67 89"

    For multiple recipient, we need to separate numbers by ";" and it is working fine with all numbers which do not have spaces.

    Do you have the same issue? Do you know what is the solution? Could you please enlighten us?

    Best regards
    Tien Dat PHAN
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...
Similar Threads - SMS Intent does
  1. thathaway
    Replies:
    3
    Views:
    144
  2. martin todd
    Replies:
    2
    Views:
    357
  3. dorlow
    Replies:
    3
    Views:
    345
  4. Ajhalls
    Replies:
    0
    Views:
    426
  5. App Update
    Replies:
    0
    Views:
    216
  6. Mortsan
    Replies:
    0
    Views:
    458
  7. Bryn Mawr
    Replies:
    6
    Views:
    457
  8. App Update
    Replies:
    1
    Views:
    312
  9. TienDat
    Replies:
    3
    Views:
    476
  10. Smiley2
    Replies:
    0
    Views:
    293

Share This Page

Loading...