Android:如何显示安装在我的设备上的拨号程序列表,而不是直接调用默认拨号程序 [英] Android: How to show a list of dialer app installed on my device instead of directly calling default dialer
问题描述
Android:如何显示安装在我的设备上的拨号程序列表,而不是直接调用默认拨号程序
Android: How to show a list of dialer app installed on my device instead of directly calling default dialer
Intent intent = new Intent(Intent.ACTION_CALL);
startActivity(intent);
权限-
<uses-permission android:name="android.permission.CALL_PHONE" />
因此,使用此代码将调用deault拨号器应用程序.我想要Android会向我建议可用于调用功能的应用程序列表的行为.
So with this code the deault dialer app gets called. I want the behavior where Android suggest me the list of apps that could be used for calling feature.
推荐答案
使用ACTION_CALL意向时无法显示拨号程序列表.
You can not show list of dialer while using ACTION_CALL intent.
您需要特殊权限,因为ACTION_CALL是受保护的操作,允许您直接拨打电话号码,而无需用户干预.
You need a special permission because the ACTION_CALL is a protected action, allow you to call a phone number directly, with no interaction from the user.
您可以为ACTION_DIAL意向选择意向选择器,以显示具有拨号程序的应用程序列表.您可以使用此代码.
You can make Intent chooser for ACTION_DIAL intent which allows you to show list of apps which has dialer. You can use this code.
final Intent intent = new Intent();
intent.setAction(Intent.ACTION_DIAL);
intent.setData(Uri.fromParts("tel", "123456", null));
startActivity(Intent.createChooser(intent, ""), REQUEST_CODE));
希望对您有帮助!
这篇关于Android:如何显示安装在我的设备上的拨号程序列表,而不是直接调用默认拨号程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!