Android以编程方式拨打电话号码 [英] Android dial a phone number programmatically

查看:225
本文介绍了Android以编程方式拨打电话号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从Android应用程序中以编程方式dial a number?我不想打个电话,我知道可以通过发出一个意图来做到:new Intent(Intent.ACTION_CALL),我只想将用户带到输入了已经的数字的Android拨号提示下通过将其传递给意图,以便她可以选择自己拨打该电话号码.

How do I dial a number programmatically from the Android application? I don't want to make a call, which I know I can do by making an intent: new Intent(Intent.ACTION_CALL), I just want to take the user to the Android dial prompt, with the number already input by passing it through the intent, so that she has the option to call that number herself.

推荐答案

使用以下代码:

Uri number = Uri.parse("tel:123456789");
Intent callIntent = new Intent(Intent.ACTION_DIAL, number);
startActivity(callIntent);

这篇关于Android以编程方式拨打电话号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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