如何列出匹配意图哪些活动? [英] How to list Activities which match an intent?
问题描述
我有这都是通过一个主应用程序纯粹是推出了一些单独的应用程序。
我想知道如果我能够使用意图来检索所有符合一些意向发现其子应用程序列表。
主要应用目前需要知道使用什么样的意图来启动这些子应用,但有使用意向,看看是否有其他活动的设备匹配了一套意向过滤器的方法吗?
我想知道如果我能够使用
意图要检索的所有列表
匹配其中一些子应用
发现意图。
块引用>当然可以。使用
软件包管理系统
,也可能是queryIntentActivities()
的方法,来实现自己的目标。I have a few separate applications which are all launched purely through a main application.
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.
The main application currently needs to know what Intents to use to START these sub-applications, but is there a way to use intents to see if other Activities on the device match a set of 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.
Absolutely. Use
PackageManager
, and probably thequeryIntentActivities()
method, to achieve your goals.这篇关于如何列出匹配意图哪些活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!