The sendTextMessage
method will throw an IllegalArgumentException
if the first or third parameter is empty.
As seen in the documentation...
public void sendTextMessage (String destinationAddress, String scAddress,
String text, PendingIntent sentIntent, PendingIntent deliveryIntent)
Throws
IllegalArgumentException if destinationAddress or text are empty
Ensure that the the first and third parameters are not empty. Thatis most likely the problem.
In your question you have said you made sure your number
variable is correct. In that case, your text
variable must be empty. Post your declaration of it.