send blank SMS with SmsManager.sendTextMessage method in android

Posted by Dany Wehbe on Stack Overflow See other posts from Stack Overflow or by Dany Wehbe
Published on 2012-12-14T22:00:16Z Indexed on 2012/12/14 23:03 UTC
Read the original article Hit count: 262

I created an android app and one of its functions is to send SMS, when I try to send blank SMS it throws an exception.

Here is the code:

SmsManager sm=SmsManager.getDefault();
sm.sendTextMessage("9999", null, messageBody,sentPI, deliveredPI);

messageBody maybe empty string and maybe it is a string, previous method throws IllegalArgumentException when messageBody is empty string!

what can I do to send blank SMS?

© Stack Overflow or respective owner

Related posts about android

Related posts about sms