How to run USSD commands on android?

后端 未结 2 765
臣服心动
臣服心动 2020-12-05 08:45

has anyone know how to runs USSD command for checking phone\'s credit balance (the number is *123#) and get the result (the credit balance) for further processing?? thankss<

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-05 09:17

    You can use "%23" instead of "#" :

    String ussdCode = "*" + "123"+"%23";
    startActivity(new Intent("android.intent.action.CALL", Uri.parse("tel:" + ussdCode)));
    

    You should also add permission to your Manifest file:

    
    

提交回复
热议问题