If you specify MATCH_DEFAULT_ONLY
the call will return a ResolveInfo
object for all activities that match the provided Intent
. When performing the matching, Android will only consider activities that have CATEGORY=DEFAULT
in their <intent-filter>
definition in the manifest. This is the same matching behaviour as used when calling startActivity()
on the Intent
. If you do not specify this flag, the query will return all matching activities, even ones that do not contain CATEGORY=DEFAULT
in their <intent-filter>
. Of course, if the Intent
that you pass to queryIntentActivities()
already contains CATEGORY=DEFAULT
, then the flag is not needed.
If you specify GET_INTENT_FILTERS
, the resulting ResolveInfo
objects will also contain the IntentFilter
that was successfully matched. You can access this via ResolveInfo.filter
.
These 2 flags are not mutually exclusive. MATCH_DEFAULT_ONLY
controls how the matching is performed to determine which ResolveInfo
objects to return. GET_INTENT_FILTERS
controls what (additional) information is returned in the ResolveInfo
objects themselves. If you want you can specify both flags like this MATCH_DEFAULT_ONLY | GET_INTENT_FILTERS