Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list Activities which match an intent?

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?

like image 469
Adam Avatar asked Apr 17 '10 20:04

Adam


1 Answers

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().

like image 127
CommonsWare Avatar answered Nov 15 '22 01:11

CommonsWare