Android 特殊字符电话号码和 ACTION_CALL 问题

发布于 2024-11-26 22:17:12 字数 318 浏览 4 评论 0原文

我发现了一个无法找到解决方案的问题,也许有人以前见过这个?

我用它来执行呼叫,现在如果呼叫是特殊号码,例如*111#,字符#不会发送到活动,导致呼叫*111而没有#字符。



    Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber));
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    this.startActivity(intent);

有人明白会发生什么吗?

I found a problem which I can't find solution, maybe someone has seen this before?

I use this to perform a call, now if the call is a special number such as *111#, the character # is not sent to the activity, resulting in a call to *111 without the # character.



    Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber));
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    this.startActivity(intent);

Anyone understand what happens?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

知足的幸福 2024-12-03 22:17:12

您应该对您的 tel:*111# 进行 url 编码:

String telUri = "tel:" + Uri.encode("*111#");

You should url-encode your tel:*111#:

String telUri = "tel:" + Uri.encode("*111#");
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文