如何在双SIM卡Android手机中找到来电的目标SIM卡?

编程入门 行业动态 更新时间:2024-10-24 09:29:00
本文介绍了如何在双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卡?

本文发布于:2023-11-28 06:41:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1641334.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:目标   中找到   如何在   手机   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!