I am trying to automatically send SMS message to a certain number when the user presses a button on the screen.
This is my code:
Intent smsIntent = n
Try this code:
String messageToSend = "this is a message";
String number = "2121234567";
SmsManager.getDefault().sendTextMessage(number, null, messageToSend, null,null);
With regards to the number, you need to enter the number as if you were calling it from the phone or sending an sms message in the normal manner.