为什么'#'在我的推广不是正在拨打的Andr​​oid? [英] Why are '#' s in my extension not being dialed in Android?

查看:142
本文介绍了为什么'#'在我的推广不是正在拨打的Andr​​oid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是一些code我使用拨打一个电话号码。它工作正常,除了当我把一个'#'的延伸。的','s为分机拨打之前引起的延迟。为什么不'#'得到拨?基本上,#后的任何数字都只是刚刚丢弃。

 串号=555-555-5555,1#123
//#不拨,也不是123
意向意图=新的Intent();
intent.setAction(Intent.ACTION_CALL);
URI URI = Uri.parse(电话:+号);
Log.d(URI,uri.toString());
intent.setData(Uri.parse(电话:+号));
context.startActivity(意向);


解决方案

您需要做的字符串连接codedHash = Uri.en code(#)与ACTION_CALL发送。

Here is some code I am using to dial a phone number. It works fine, except for when I put a '#' in the extension. The ','s are to cause a delay before the extension is dialed. Why doesn't the '#' get dialed? Basically, any numbers after the # are just getting discarded.

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);

解决方案

You need to do String encodedHash = Uri.encode("#") to send it with ACTION_CALL.

这篇关于为什么'#'在我的推广不是正在拨打的Andr​​oid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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