发起呼叫在Android上使用特殊字符# [英] initiate a phone call on android with special character #

查看:283
本文介绍了发起呼叫在Android上使用特殊字符#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用下面的code从内部的Andr​​oid应用程序发起呼叫:

I use the following code to launch a call from within the android app:

intent.setData(Uri.parse("tel:+12345 #123"));
startActivity(intent);

虽然它开始通话,却忽视了一切开始的#。

While it starts the call, it ignores everything starting with the #.

我读一些有关修改SpecialCharSequenceMgr.java文件,但我找不到这个任何地方,老实说不知道究竟一个人做。什么是解决这个问题的最好方法是什么?

I read something about modifying SpecialCharSequenceMgr.java file, but I can't find this anywhere and quite honestly don't know what exactly one has to do. What is the best way to solve this?

推荐答案

我相信这个问题是该#符号在URI的一个特殊的意义,所以你使用<$ C $必须连接code这C> Uri.en code()的方法是这样的:

I believe the problem is the that the # symbol has a special meaning in URIs, so you have to encode it using the Uri.encode() method like this:

    Intent out = new Intent();
    out.setAction(Intent.ACTION_DIAL);
    out.setData(Uri.parse("tel:" + Uri.encode("+12345#123")));
    startActivity(out);

这篇关于发起呼叫在Android上使用特殊字符#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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