我有几个单独的应用程序,它们都是完全通过主应用程序启动的。
我想知道我是否能够使用 Intent 来检索与某些发现 Intent 匹配的所有子应用程序的列表。
主应用程序目前需要知道使用什么 Intent 来启动这些子应用程序,但是有没有一种方法可以使用 Intent 来查看设备上的其他 Activity 是否与一组 Intent-filters 匹配?
最佳答案
I am wondering if I'd be able to use intents to retrieve a list of all the sub-applications which match some discovery intent.
当然。使用 PackageManager
,可能还有 queryIntentActivities()
方法来实现您的目标。
This old sample Java code演示了通过 queryIntentActivities()
查找所有启动器 Activity 。
关于android - 如何列出符合 Intent 的 Activity ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2659898/