简体   繁体   English

Android:如何显示安装在我的设备上的拨号程序列表,而不是直接调用默认拨号程序

[英]Android: How to show a list of dialer app installed on my device instead of directly calling default dialer

Android: How to show a list of dialer app installed on my device instead of directly calling default dialer Android:如何显示安装在我的设备上的拨号程序列表,而不是直接调用默认拨号程序

Intent intent = new Intent(Intent.ACTION_CALL);
startActivity(intent); 

permission - 许可-

<uses-permission android:name="android.permission.CALL_PHONE" /> 

So with this code the deault dialer app gets called. 因此,使用此代码可以调用deault拨号程序。 I want the behavior where Android suggest me the list of apps that could be used for calling feature. 我想要Android向我建议可用于调用功能的应用程序列表的行为。

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_CALL是受保护的操作,允许您直接拨打电话号码,而无需用户进行任何交互。

You can make Intent chooser for ACTION_DIAL intent which allows you to show list of apps which has dialer. 您可以为ACTION_DIAL意向设置意向选择器,以显示具有拨号程序的应用程序列表。 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));

I hope it helps! 希望对您有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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