如何在最后以#使用Uri.parse() [英] How to use Uri.parse() with # at the end

查看:680
本文介绍了如何在最后以#使用Uri.parse()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用GSM codeS与Android应用转移我的电话。
例如,如果我叫:** 21 * otherNumber#
我所有的电话将在otherNumber被转移。

I try to use GSM codes to transfer my calls with an android app. For example, if I call : **21*otherNumber# All my calls will be transfered on otherNumber.

我的code:

Uri transfert = Uri.parse( "tel:**21*" + numero + "#");
Intent intent = new Intent( Intent.ACTION_CALL, transfert );
startActivity(intent);

不过,Uri.parse()有定义:
一个URI引用包括URI和片段,下面有'#'的URI的组成部分

However, Uri.parse() has for definition: " A URI reference includes a URI and a fragment, the component of the URI following a '#' "

因此​​,删除#,但我需要它。在GSM code不能工作离不开它了。

So, it removes the # but I need it. The GSM code can't works without it.

有人将有一个想法?

推荐答案

我不认为你不能拨打分机与手机号码,这是一个已知的问题(的看到这个)。

I don't think you can't dial phone number with extensions, it's a known issue (see this).

据<一个href=\"http://stackoverflow.com/questions/11774884/android-how-to-make-a-call-that-includes-or-p-in-the-dial\">this线程,你可以尝试添加 23% Uri.parse(电话:** 21 *+ NUMERO +% 23);

According to this thread, you may try to add %23 like Uri.parse( "tel:**21*" + numero + "%23");

这篇关于如何在最后以#使用Uri.parse()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆