Detect target phone number on incoming call

别来无恙 提交于 2019-11-30 22:47:17

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:

  1. Checking for dual sim.
  2. Question regarding ui.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!