1

i am using dual sim phone. Now i want to run USSD code by one particular network without selecting the operator to call.

my code:

 String ussdCode = "*" + "123" + Uri.encode("#");
        startActivity(new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + ussdCode)));

Response: now it was asking me to select the operator to call the ussd code. I want to run that USSD Code by that particular operator without asking.

Thank you in advance.

kartheeki j
  • 2,206
  • 5
  • 27
  • 51
  • USSD is not supported in Android. There is no API to make a USSD call. – Gabe Sechan Feb 25 '17 at 06:34
  • @GabeSechan : the code he shares exactly fire an intent to make a ussd call ! what do you mean by not supporting that? – Arash GM Feb 25 '17 at 06:38
  • 1
    @Arash THere is no built in way to make a USSD via an API. You can't choose what SIM does it, you can't get a result. There's no promise that the dialer app will actually support USSD or make a USSD request, or show any result if it does, or support all USSD features. Basically you have something that will maybe kinda sorta work on some phones. – Gabe Sechan Feb 25 '17 at 06:40

1 Answers1

1

With Samsung devices use the below

callIntent.putExtra("simSlot", simSlot);

where simSlot is integer as 0,1

Hussein mahyoub
  • 335
  • 4
  • 6