如何在 Android 手机中制作我自己的自定义拨号器 [英] How to make my own custom dialer in an Android phone

查看:28
本文介绍了如何在 Android 手机中制作我自己的自定义拨号器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我添加了一个意图,以便用户可以调用:

In my application I add an intent so that the user can call:

str="tel:"+phoneArray[11];  
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse(str));
startActivity(intent);

然后它从 Android 手机调用,但我想设置另一个外观不同的自定义拨号器.需要做什么?我不是指如何设计拨号器,而是指如何制作一个可以输入号码并执行呼叫的UI.

Then it calls from Android phone but I want to set up another custom dialer with a different look. What do need to do? I do not mean how to design the dialer, but only how to make a UI that will enter the number and execute a call.

推荐答案

创建响应 Intent.ACTION_DIAL 的应用.在 AndroidManifest.xml 中,您需要将以下内容添加到该 Activity:

Create an app that responds to Intent.ACTION_DIAL. In the AndroidManifest.xml you need to add the following to that Activity:

<intent-filter>
    <action android:name="android.intent.action.DIAL" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

您可以参考官方手机应用.但请注意,这并非易事.

You can take the official phone app as reference. But be warned, it is no trivial task.

您只能以这种方式更换拨号器.实际通话内容(您在通话中看到的内容)无法更改.

You can replace only the Dialer that way. The actual calling thing (what you see during calls) can't be changed.

有关详细信息,请参阅堆栈溢出问题Android 拨号器应用程序.

For more information, see Stack Overflow question Android dialer application.

这篇关于如何在 Android 手机中制作我自己的自定义拨号器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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