当我直接从听筒拨打a时,它可以正常工作。例如:*123#获取数量平衡。
然而,当我试图在应用程序中做同样的事情时,我遇到了一个问题。拨号器中显示的号码缺少结尾#。我需要它在我的应用程序,我希望我的应用程序应该支持所有的USSD代码。
有没有办法在应用程序中拨打ussd代码?
发布于 2012-04-19 01:46:53
我不完全确定,但我认为android还不支持USSD,但是你可以尝试这个变通方法:
String encodedHash = Uri.encode("#");
String ussd = "*" + encodedHash + "123" + encodedHash;
startActivityForResult(new Intent("android.intent.action.CALL",
Uri.parse("tel:" + ussd)), 1);发布于 2018-06-12 18:29:56
String encodedHash = Uri.encode("*123#");
startActivityForResult(new Intent("android.intent.action.CALL",
Uri.parse("tel:" + encodedHash)), 1);https://stackoverflow.com/questions/10214915
复制相似问题