我有一部带2张SIM卡的Android手机,我想检测来电的目标 - 是SIM卡还是SIM卡2.是否可以从通话信息中获取目标号码?
Finally i got the solution its working fine for me. Hope it should helpful for everyone who wants to handle Duel SIM in mobile applications.
public class IncomingCallInterceptor extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String callingSIM = "";
Bundle bundle = intent.getExtras();
callingSIM =String.valueOf(bundle.getInt("simId", -1));
if(callingSIM == "0"){
// Incoming call from SIM1
}
else if(callingSIM =="1"){
// Incoming call from SIM2
}
}
}
Your question dosent have answers in the documentations...
But I found out some links that may help you out:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.