简体   繁体   中英

How to make my own custom dialer in an Android phone

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.

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.

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

如果你想完全替换现有的电话拨号器并在你的应用程序中管理呼叫,那么答案是,除了你在更改用自己的默认拨号器替换默认拨号器的android源代码后构建的自定义ROM之外,这是无法完成的。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM