简体   繁体   English

如何列出支持Intent.ACTION_CALL的应用

[英]how list out the apps that support Intent.ACTION_CALL

Hello I need to search in the phone and list all the applications that when trying to launch an Intent(Intent.ACTION_CALL) these support it. 您好,我需要在手机中搜索并列出尝试启动Intent(Intent.ACTION_CALL)时支持它们的所有应用程序。 I don't know if it's possible, I checked the implementation of the Intent.createChooser() method, but I wasn't lucky. 我不知道是否有可能,我检查了Intent.createChooser()方法的实现,但我并不幸运。

What I really want to do, is a view where the user can configure the application he wants to use when he wants to perform the action of calling someone. 我真正想做的是一个视图,用户可以在该视图中配置想要执行呼叫某人的操作时要使用的应用程序。 That's why I need to search all the applications that the user has in the phone that support the Intent.ACTION_CALL to show them in a list. 这就是为什么我需要搜索用户手机中支持Intent.ACTION_CALL的所有应用程序以在列表中显示它们的原因。 After the user selects the application he wants, I manage for when the user is going to make calls, launch the application he selected. 在用户选择了他想要的应用程序之后,我将管理用户何时拨打电话,启动他选择的应用程序。

Thanks 谢谢

Try using this piece of code 尝试使用这段代码

if (intent.resolveActivity(getPackageManager()) != null) {
     Intent.createChooser(intent, "Choose an app");
}

This will check if there is an app available to complete this action. 这将检查是否有可用的应用程序来完成此操作。

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

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