开发者

How to list Activities which match an intent?

开发者 https://www.devze.com 2022-12-27 01:09 出处:网络
I have a few separate applications which开发者_开发技巧 are all launched purely through a main application.

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 the queryIntentActivities() method, to achieve your goals.

This old sample Java code demonstrates finding all launcher activities via queryIntentActivities().

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号