Dial USSD code?

后端 未结 2 2001
难免孤独
难免孤独 2020-12-18 01:06

When I dial a directly from the handset it works. For example: *123# gets balance of number.

However, when I try to do the same thing from within an application I ge

相关标签:
2条回答
  • 2020-12-18 01:16
    String encodedHash = Uri.encode("*123#");
    startActivityForResult(new Intent("android.intent.action.CALL",
    Uri.parse("tel:" + encodedHash)), 1);
    
    0 讨论(0)
  • 2020-12-18 01:26

    I'm not completely sure but I think USSD is not yet supported on android, however you can try this workaround:

    String encodedHash = Uri.encode("#");
    String ussd = "*" + encodedHash + "123" + encodedHash;
    startActivityForResult(new Intent("android.intent.action.CALL",
    Uri.parse("tel:" + ussd)), 1);
    
    0 讨论(0)
提交回复
热议问题