How to find out which SIM is making the outgoing call (Dual SIM)

前端 未结 5 1377
[愿得一人]
[愿得一人] 2020-12-31 19:47

I would like to check which SIM is making an outgoing call for DUAL SIM android phones. Read this article Android : Check whether the phone is dual SIM.

Works like a

5条回答
  •  暖寄归人
    2020-12-31 20:33

    I've tested and for Jelly Bean I was able to successfully identify the dialling SIM card. Tested also with triple SIM device and worked like a charm.

    Code snippet for this inside your BroadcastReceiver:

    int whichSIM = 0; // this for security fallback to SIM 1
    
    if (intent.getExtras().containsKey("subscription")) {
    
        whichSIM = intent.getExtras().getInt("subscription");
    
    }
    
    // do whatever you need to with the information
    

提交回复
热议问题