制作以数字分机电话呼叫 [英] Making a Phone Call with a Number Extension

查看:230
本文介绍了制作以数字分机电话呼叫的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有code,允许用户点击一个按钮,拨打电话:

I have code to allow a user to click a button to make a phone call:

public void addCallButton(){
    ImageButton button = (ImageButton) findViewById(R.id.callUsButton);
    button.setOnClickListener(new OnClickListener(){
        public void onClick(View v){
            call01();
        }
    });
}

private void call01(){
    Intent callIntent = new Intent(Intent.ACTION_DIAL);
    callIntent.setData(Uri.parse("tel:123456789"));
    startActivity(callIntent);
}

但是,一个需要拨打的号码是(123)456-789恩。 123

如何添加在code中的分机号码?

How do I add the extension number in the code?

推荐答案

您是否尝试过使用 PhoneNumberUtils.PAUSE PhoneNumberUtils.WAIT ?你将不得不把他们中的任何一个分机号码的前面。

Have you tried using PhoneNumberUtils.PAUSE or PhoneNumberUtils.WAIT? You would have to put either one of them in front of the extension number.

因此​​,这将是

So it would be

callIntent.setData(Uri.parse("tel:123456789"+PhoneNumberUtils.PAUSE+"#123"));    

这篇关于制作以数字分机电话呼叫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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