如何在 Android 手机中制作我自己的自定义拨号器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10303138/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 03:12:47  来源:igfitidea点击:

How to make my own custom dialer in an Android phone

androidandroid-layoutandroid-intent

提问by zapl

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);

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.

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

回答by zapl

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

创建一个响应Intent.ACTION_DIAL. 在AndroidManifest.xml您需要将以下内容添加到该活动中:

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

You can take the official phone appas 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.

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

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

有关更多信息,请参阅 Stack Overflow 问题Android 拨号器应用程序

回答by Ahmed Korany

If you want to totally replace the existing phone dialler and manage the call from within your application then the answer is that this can't be done except on custom ROM you build after changing the android source code replacing the default dialler with your own.

如果您想完全替换现有的电话拨号器并从您的应用程序内管理呼叫,那么答案是这不能完成,除非您在更改 android 源代码后构建的自定义 ROM 上使用您自己的替换默认拨号器。

回答by ooo

You can place an overlay over the actual phone call when it shows up. There are loads of phone skin apps like this

当它出现时,您可以在实际电话呼叫上放置一个覆盖图。有很多这样的手机皮肤应用程序