如何使一个呼叫,而不使用意图 [英] how to make a call, without using intent

查看:150
本文介绍了如何使一个呼叫,而不使用意图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能让没有呼叫/用户交互。

How can I make a call without/with user interaction.

我发现的意图 Intent.ACTION_CALL 在互联网上,但我想写程序像它发起呼叫在这个意图的反应之一,这可能吗?如果这是可能的,那么我该怎么办呢?

I found the intent Intent.ACTION_CALL on the internet, but I want to write program like the one which initiates a call in response of this intent, is this possible? If this is possible, then how can I do this?

我不希望启动一个对话框,拨一个电话,我想在内部使我的应用程序的调用。

I do not want to initiate a dialog to dial for a call, I want to internally make a call in my application.

有任何Java库,我可以用于此用途?

Is there any java library, which I can use for this purpose?

推荐答案

使用意图。这就是它是如何设计在Android中的工作:

Use Intent. That's how it is designed to work in Android:

try {
   startActivity(new Intent(Intent.ACTION_CALL, 
                     Uri.parse("tel:PHONE_NUMBER_HERE" )));
} catch (Exception e) {
   e.printStackTrace();
}

这将开始拨号。

这篇关于如何使一个呼叫,而不使用意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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