2

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.

Is there any API available to detect the target SIM ?

Manish Agrawal
  • 551
  • 2
  • 6
  • 22

1 Answers1

-2

in lollipop 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
  }
}

}

tested in Lenovo K3 note

Hamidreza Sadegh
  • 2,155
  • 31
  • 33