暂停发送到拨号器 [英] Sending pause to dialer

查看:246
本文介绍了暂停发送到拨号器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个类似的静脉发送在android系统,我想送暂停字符,到拨号器。这适用于HTC Sense的手机,甚至对Xoom的,而不是像上了Nexus One或T-Mobile G2的股票体验手机(我怀疑摩托罗拉Droid)。

In a similar vein to Sending Pause and DTMF input in android, I'm trying to send the pause character "," to the dialer. This works on HTC Sense phones and even on the Xoom, but not on "stock experience" phones like the Nexus One or T-Mobile G2 (and I suspect the Motorola Droid).

这些手机似乎试图将pretty格式的数字拨号器(即加破折号),并停止在创下了逗号。有趣的是,它不呛上的P字,但它会去掉PS和不断增加的数字。

These phones seem to have a dialer that tries to pretty-format the number (ie adding dashes) and stop upon hitting a comma character. Interestingly, it doesn't choke on a "p" character, though it will strip out "p"s and keep adding numbers.

下面是ActivityManager看到的是:

Here is what the ActivityManager sees:

I/ActivityManager(   92): Starting activity: Intent { act=android.intent.action.DIAL dat=tel:8883333,444 cmp=com.android.contacts/.DialtactsActivity }

我也尝试了EN codeD形式,联系电话:8883333%2C444对这些手机的行为没有区别。我已经试过P,如提及,但这些人物都将被丢弃导致有误填888-333-3444的拨号器,我不知道,P是正确的呢。

I've also tried the encoded form, "tel:8883333%2C444" with no difference in behavior on these phones. I've tried "p", as mentioned, but these characters are dropped resulting in the dialers having 888-333-3444 incorrectly populated, and I'm not sure that "p" is correct anyway.

因此​​,问题:是否有指定在大多数或所有Android拨号器工作的停顿的方式

So, the question: Is there a way to specify a pause that works across most or all android dialers?

推荐答案

简短的回答:看起来不像有可能使用原生的拨号

Short answer: Doesn't look like it's possible using the native dialer.

龙答:

在Android的原生拨号器使用以下code。使用提取你传递给拨号数的意图

The native dialer in Android uses the following code to extract the number you pass in to the dialer using an Intent

if ("tel".equals(uri.getScheme())) {
  // Put the requested number into the input area
  String data = uri.getSchemeSpecificPart();
  setFormattedDigits(data, null);
  return true;
} 

setFormattedDigits 方法数被转换正是如此:

Within the setFormattedDigits method the number gets transformed thusly:

  String dialString = PhoneNumberUtils.extractNetworkPortion(data);

在文档

寻找 extractNetworkPortion ,你会发现它,提取网络地址部分[地方]网络地址部分是一切的到DTMF控制位分隔符(暂停或等待)

Looking at the docs for extractNetworkPortion you'll notice that it, "Extracts the network address portion [where the] Network address portion is everything up to DTMF control digit separators (pause or wait).

所以,code有意分拆出来的暂停字符后它自带东西。我能想到的唯一的选择是,以取代拨号或使用 ACTION_CALL 动作,而不是 ACTION_DIAL 。这将绕过拨号程序,所以应该谨慎使用。

So the code is intentionally striping out the pause character and anything that comes after it. The only alternative I can think of is to replace the dialer or use the ACTION_CALL action instead of ACTION_DIAL. That'll bypass the dialer, so it should be used with caution.

这篇关于暂停发送到拨号器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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