When I use this code:
String numberToSendFor = "21987654321";
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(numberToSendFor, null, "Test Message", null, null);
The SMS Message is sent normally (and goes to sent messages list in my phone).
But, when I use this:
String numberToSendFor = "21987654321";
String messageToSend = "Test Message"; // store the message into a variable
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(numberToSendFor, null, messageToSend, null, null);
The message don't is sent and don't goes to sent messages list.
What should I do to send message from a variable?
Note: I have the permission to send SMS (AndroidManifest.xml).
Thanks.