PackageManager.QueryIntentActivityOptions Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| QueryIntentActivityOptions(ComponentName, Intent[], Intent, PackageInfoFlags) |
Retrieve a set of activities that should be presented to the user as similar options. |
| QueryIntentActivityOptions(ComponentName, IList<Intent>, Intent, PackageInfoFlags) |
Intended to find activity choices for a general intent and optional specific intents; this overload has a known JNI binding defect. |
QueryIntentActivityOptions(ComponentName, Intent[], Intent, PackageInfoFlags)
Retrieve a set of activities that should be presented to the user as similar options.
[Android.Runtime.Register("queryIntentActivityOptions", "(Landroid/content/ComponentName;[Landroid/content/Intent;Landroid/content/Intent;I)Ljava/util/List;", "GetQueryIntentActivityOptions_Landroid_content_ComponentName_arrayLandroid_content_Intent_Landroid_content_Intent_IHandler")]
public abstract System.Collections.Generic.IList<Android.Content.PM.ResolveInfo> QueryIntentActivityOptions(Android.Content.ComponentName? caller, Android.Content.Intent[]? specifics, Android.Content.Intent intent, Android.Content.PM.PackageInfoFlags flags);
[<Android.Runtime.Register("queryIntentActivityOptions", "(Landroid/content/ComponentName;[Landroid/content/Intent;Landroid/content/Intent;I)Ljava/util/List;", "GetQueryIntentActivityOptions_Landroid_content_ComponentName_arrayLandroid_content_Intent_Landroid_content_Intent_IHandler")>]
abstract member QueryIntentActivityOptions : Android.Content.ComponentName * Android.Content.Intent[] * Android.Content.Intent * Android.Content.PM.PackageInfoFlags -> System.Collections.Generic.IList<Android.Content.PM.ResolveInfo>
Parameters
- caller
- ComponentName
The class name of the activity that is making the request. This activity will never appear in the output list. Can be null.
- specifics
- Intent[]
An array of Intents that should be resolved to the first specific results. Can be null.
- intent
- Intent
The desired intent as per resolveActivity().
- flags
- PackageInfoFlags
Additional option flags to modify the data returned. The
most important is #MATCH_DEFAULT_ONLY, to limit the
resolution to only those activities that support the
android.content.Intent#CATEGORY_DEFAULT.
Returns
Returns a List of ResolveInfo objects containing one entry for each matching activity. The list is ordered first by all of the intents resolved in specifics and then any additional activities that can handle intent but did not get included by one of the specifics intents. If there are no matching activities, an empty list is returned.
- Attributes
Remarks
Retrieve a set of activities that should be presented to the user as similar options. This is like #queryIntentActivities, except it also allows you to supply a list of more explicit Intents that you would like to resolve to particular options, and takes care of returning the final ResolveInfo list in a reasonable order, with no duplicates, based on those inputs.
Use #queryIntentActivityOptions(ComponentName, List, Intent, ResolveInfoFlags) when long flags are needed.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
QueryIntentActivityOptions(ComponentName, IList<Intent>, Intent, PackageInfoFlags)
Intended to find activity choices for a general intent and optional specific intents; this overload has a known JNI binding defect.
[Android.Runtime.Register("queryIntentActivityOptions", "(Landroid/content/ComponentName;Ljava/util/List;Landroid/content/Intent;I)Ljava/util/List;", "GetQueryIntentActivityOptions_Landroid_content_ComponentName_Ljava_util_List_Landroid_content_Intent_IHandler", ApiSince=33)]
public virtual System.Collections.Generic.IList<Android.Content.PM.ResolveInfo> QueryIntentActivityOptions(Android.Content.ComponentName? caller, System.Collections.Generic.IList<Android.Content.Intent>? specifics, Android.Content.Intent intent, Android.Content.PM.PackageInfoFlags flags);
[<Android.Runtime.Register("queryIntentActivityOptions", "(Landroid/content/ComponentName;Ljava/util/List;Landroid/content/Intent;I)Ljava/util/List;", "GetQueryIntentActivityOptions_Landroid_content_ComponentName_Ljava_util_List_Landroid_content_Intent_IHandler", ApiSince=33)>]
abstract member QueryIntentActivityOptions : Android.Content.ComponentName * System.Collections.Generic.IList<Android.Content.Intent> * Android.Content.Intent * Android.Content.PM.PackageInfoFlags -> System.Collections.Generic.IList<Android.Content.PM.ResolveInfo>
override this.QueryIntentActivityOptions : Android.Content.ComponentName * System.Collections.Generic.IList<Android.Content.Intent> * Android.Content.Intent * Android.Content.PM.PackageInfoFlags -> System.Collections.Generic.IList<Android.Content.PM.ResolveInfo>
Parameters
- caller
- ComponentName
The activity component to exclude from the intended query results, or null for no caller exclusion.
Optional intents whose resolved activities are placed before the general results in the intended query, or null.
- intent
- Intent
The general intent used to find the remaining activity choices in the intended query.
- flags
- PackageInfoFlags
The integer query options passed by the current binding. The intended Android list overload requires a PackageManager.ResolveInfoFlags object instead.
Returns
For the intended query, activity results for specifics followed by remaining matches for intent, or an empty list if no activities remain. This is not a result guarantee for the incorrectly registered overload.
- Attributes
Remarks
Binding limitation: In .NET for Android 37.2.31, this overload is registered with a Java list and an integer flags argument. Android declares its list overload with a PackageManager.ResolveInfoFlags object instead. The generated binding passes the integer directly; it does not construct that flags object. This defect is tracked in dotnet/android#13576.
The parameter and result descriptions document the intended Android query, not a successful call through this incorrect registration. They do not establish the behavior of every receiver or application-specific JNI remapping.
The intended query places resolved specific intents first, in their input order, then retains the remaining general results. A null specifics list omits the specific choices. A non-null caller requests removal of a matching activity from the results.