I have an Android phone with 2 SIM card and I want to detect the target of the incoming call — is it for SIM 1 or for SIM 2. Is it possible to get the target number from call info?
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
}
}
}
amalBit
Your question dosent have answers in the documentations...
But I found out some links that may help you out:
来源:https://stackoverflow.com/questions/17618651/detect-target-phone-number-on-incoming-call