这是我的代码,如果我123
想要调用它以便1
使用 sim 号码,否则使用 sim 号码 2,但它不起作用:
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);