2

这是我用来拨打电话号码的一些代码。它工作正常,除了我在扩展名中放了一个“#”。',' 将在分机拨号前造成延迟。为什么不拨“#”?基本上,# 之后的任何数字都会被丢弃。

String number = "555-555-5555,,1#123"
// # is not dialed, neither are 123
Intent intent = new Intent();
intent.setAction(Intent.ACTION_CALL);
Uri uri = Uri.parse("tel:" + number);
Log.d("URI", uri.toString());
intent.setData(Uri.parse("tel:" + number));
context.startActivity(intent);
4

3 回答 3

3

字符“#”被排除在外,因为它用于从 URI 引用中的片段标识符分隔 URI

你需要使用Uri.encode(yourEncodeDailString)

于 2012-05-14T15:23:50.717 回答
2

您需要String encodedHash = Uri.encode("#")使用 ACTION_CALL 发送它。

于 2012-05-14T15:24:38.743 回答
0

您也许可以将 # 替换为 %23。

于 2016-09-14T19:39:16.887 回答