This is my code, if I call with 123
I want it such that sim number 1
is used, else use sim number 2, but it is not working:
String number="123";
if(number.equals("123")){
Intent callIntent = new Intent(Intent.ACTION_CALL)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
callIntent.setData(Uri.parse("tel:"+number));
callIntent.putExtra("com.android.phone.extra.slot", 0); //For sim 1
startActivity(callIntent);
} else {
Intent callIntent = new Intent(Intent.ACTION_CALL)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
callIntent.setData(Uri.parse("tel:"+number));
callIntent.putExtra("com.android.phone.extra.slot", 1); //For sim2
startActivity(callIntent);