我需要在我的 Android 应用程序中调用电话,拨号盘中包含“#”或“p”。
如果我使用下一个代码:
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:629941945#22412"));
startActivity(intent);
它调用号码 629941945,不带 # 和 22412。
如果我使用下一个代码:
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:629941945p22412"));
startActivity(intent);
它在没有 “p”的情况下调用电话:62994194522412。
有表格可以解决吗?
最佳答案
Intent shortcutIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:"+Uri.encode("*111*2#")));
startActivity(shortcutIntent);
关于Android 如何调用拨号中包含 "#"或 "p"的电话?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11774884/