I am working on an android application in which I want to send Sms with SmsManager. Everything is working fine if I use a Single sim phone but when I use a dual sim phone I want to ask the user "from which sim card you want to send Sms" Please help me to archive that. And my device does not have the option to set the default sim card to send SMS so how can I set that programmatically.
here is my code-
private void MyMessage() {
String mobileNumber1 = "99XXXXXXXX";
String mobileNumber2 = "99XXXXXXXX";
String myMsg = "Testing Messages";
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(mobileNumber1, null, myMsg, null, null);
smsManager.sendTextMessage(mobileNumber2, null, myMsg, null, null);
Toast.makeText(this, "Message Sent", Toast.LENGTH_SHORT).show();
}