如何在我的android调用应用程序中调用时打开拨号盘并按分机号码。 [英] How to open dial-pad and press extension number during a call in my android calling application.

查看:92
本文介绍了如何在我的android调用应用程序中调用时打开拨号盘并按分机号码。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的组织开发一个应用程序,它将在主要组织编号后拨打他/她的分机后连接到任何员工桌面电话。此扩展名保存在应用程序db中。假设主要联系号码为123456789,则需要分机234#才能连接员工。



在主要活动中我们有这样的代码:



意图newIntent = new Intent();

newIntent.setAction(Intent.ACTION_CALL);

newIntent.setData(Uri.parse(tel:123456789));



按照上面的代码行,应用程序可以将调用活动启动到指定的数字。但在此之后我想知道如何实现在后台以编程方式输入分机号码。



我尝试了什么:



尝试创建新的Intent来解析broadCastReceiver类中的扩展号,如下所示:

if(stateStr.equals(TelephonyManager.EXTRA_STATE_OFFHOOK)){

state = TelephonyManager.CALL_STATE_OFFHOOK;

callReceived = true;

意图newIntent = new Intent();

newIntent.setAction (Intent.ACTION_DIAL);

newIntent.setData(Uri.parse(tel:234#));



}



但是此代码段不起作用。



然后我尝试使用MainActivity中的PAUSE / WAIT编号如下:



意图newIntent = new Intent ();

newIntent.setAction(Intent.ACTION_CALL);

newIntent.setData(Uri.parse(tel:123456789; 234#));

}

但是要求用户点击确定并发送消息发送曲调。

I am developing an apps for my organization which will connect to any employee desk phone after dialing his/her extension after main organization number. and this extension is saved in application db. suppose main contact number is "123456789" and then ext "234#" is required to connect an employee.

In Main Activity we have code like this:

Intent newIntent=new Intent();
newIntent.setAction(Intent.ACTION_CALL);
newIntent.setData(Uri.parse("tel: 123456789"));

As per above lines of code application is able to start call activity to specified number. but after this I want to know how to implement to enter extension number programmatically in background.

What I have tried:

Tried to create new Intent to parse extension number in broadCastReceiver class as below:
if(stateStr.equals(TelephonyManager.EXTRA_STATE_OFFHOOK)){
state = TelephonyManager.CALL_STATE_OFFHOOK;
callReceived=true;
Intent newIntent=new Intent();
newIntent.setAction(Intent.ACTION_DIAL);
newIntent.setData(Uri.parse("tel: 234#"));

}

But this code snippet is not working.

Then I tried with PAUSE/WAIT number in MainActivity as below:

Intent newIntent=new Intent();
newIntent.setAction(Intent.ACTION_CALL);
newIntent.setData(Uri.parse("tel: 123456789;234#"));
}
But this ask user to click 'ok' with a message to send tune.

推荐答案

请检查这个我知道你的关键事业。根据你的建议,我会尝试改进解决方案或冻结它。



java - 如何以编程方式将数字输入到android中的手机应用程序界面对话 - 堆栈溢出 [ ^ ]
Please check this thread below.Let me know with your key undertakings.As per your suggestion i will try to improve the solution or will freeze it.

java - how to programmatically enter the number into phone application screen in android during conversation - Stack Overflow[^]


这篇关于如何在我的android调用应用程序中调用时打开拨号盘并按分机号码。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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