Answer the question
In order to leave comments, you need to log in
How to give a choice to the user of the program from which SIM card to call?
I wrote a small program, when I press the button, it calls the number, and everything would be fine in this fairy tale, but I checked it on a friend’s phone and when I pressed it, it just flew out of the program, only then I remembered that he had a dual sim. So how to put that would the SIM card be 1 or 2 as standard when the program was launched? Or would it be possible for the user to choose from which SIM card to call him?
I tried to use getDeviceId (), writes that "Non-static method ...".
Here is the part of the code I use to make the call:
final Intent calling1 = new Intent(Intent.ACTION_CALL);
call1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
calling1.setData(Uri.parse("tel:5555"));
startActivity(calling1);
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question