Call through specified SIM from android

淺唱寂寞╮ 提交于 2019-12-04 13:11:48

The Android SDK doesn't provide an APIs to control the SIM being used on dual SIM mobiles. In fact, Android doesn't even really support dual SIM phones. All dual SIM devices are modified extensively by the manufacturers.

You cannot control the SIM through the Android SDK. If any OEM provides such an API for their devices, I am not aware of it, but you can try asking the manufacturer of your dual SIM device directly is such an API exists on their device.

Use ACTION_DIAL to let people select their SIM.

Nitin Karale
private void callBack(String phone, Context context) {
    Intent intent = new Intent(Intent.ACTION_CALL).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    //check wheather it is dual sim or not then

    //if sim 1
    intent.putExtra("simSlot", 0);

    //else if sim 2
    intent.putExtra("simSlot", 1); 

    intent.setData(Uri.parse("tel:" + phone));
    context.startActivity(intent);
}

Check it is dual sim or not, go through the bellow link

Android : Check whether the phone is dual SIM

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!