如何在双SIM卡Android手机中找到来电的目标SIM卡? [英] How to find target sim for an incoming call in dual sim android phone?

查看:155
本文介绍了如何在双SIM卡Android手机中找到来电的目标SIM卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个Android应用程序,在该应用程序中,我需要检测双SIM卡电话中的传入呼叫的​​目标SIM卡. Android API仅提供一个SIM卡的访问权限.我确实对此进行了搜索,但找不到解决方案.我发现的全部是,我们无法检测到目标SIM卡,因为这取决于设备制造商.

I am creating an android application in which I need to detect the target sim for an incoming call in dual sim phone. The Android API provides the access of only one SIM. I did googling about this but couldn't find the solution, All I found is that we can not detect the target SIM because this is depend upon the device manufactures.

有没有可用于检测目标SIM卡的API?

Is there any API available to detect the target SIM ?

推荐答案

在棒棒糖22+中

public class MessageReceiver extends BroadcastReceiver {
@Override
 public void onReceive(Context context, Intent intent) {  
  int slot = Integer.parseInt((String) intent.getExtras().get("slot"));
  if(slot == 0){
    // sim1
  }
  if(slot == 1){
    // sim2
  }
}

}

在Lenovo K3 note中测试

tested in Lenovo K3 note

这篇关于如何在双SIM卡Android手机中找到来电的目标SIM卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆