Reputation: 115
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?
Upvotes: 0
Views: 1418
Reputation: 13541
After looking at the Documentation:
This method:
Throws
IllegalArgumentException if destinationAddress or text are empty
Upvotes: 1