2

I'm making an app that dials a specific number on the click of a button, however, if the person has dual sim, I want to be able to let him choose which sim to use, since it works on only one service provider,

here is the code that I have so far, is there anyway to check if there is dual sim and then make the user choose which sim to call from ?

I did a search and found that the latest API has built in dual sim support, however my app won't work well with kitkat

This is my code:

public void updateBalance(View view) {
    Intent intent = new Intent(Intent.ACTION_DIAL);
    intent.setData(Uri.parse(String.format("tel:%s", Uri.encode("*121#"))));
    startActivity(intent);
}

EDIT

so basically what I am trying to do is the following

public void updateBalance(View view) {
  if (dual sim){
    Intent intent = new Intent(Intent.ACTION_DIAL);
}
else{
   Intent intent = new Intent(Intent.ACTION_CALL);
}
intent.setData(Uri.parse(String.format("tel:%s", Uri.encode("*121#"))));
startActivity(intent);
}

1 Answers1

-1

I think it depends on sim management settings in phone.

From the above code the it is moving to dial pad.

In Sim Management settings -> Default Settings -> Voice call by clicking on it a dilaog will open it shows sim1, sim2, always ask. Based on these settings it will work

if user selects particular sim it won't allow them to choose again if user selects always ask option then it will show options to choose sim.

Yasoda
  • 538
  • 5
  • 6