PackageManager.GetPreferredActivities(IList<IntentFilter>, IList<ComponentName>, String) Method

Definition

Retrieve all preferred activities, previously added with #addPreferredActivity, that are currently registered with the system.

[Android.Runtime.Register("getPreferredActivities", "(Ljava/util/List;Ljava/util/List;Ljava/lang/String;)I", "GetGetPreferredActivities_Ljava_util_List_Ljava_util_List_Ljava_lang_String_Handler")]
public abstract int GetPreferredActivities (System.Collections.Generic.IList<Android.Content.IntentFilter> outFilters, System.Collections.Generic.IList<Android.Content.ComponentName> outActivities, string? packageName);
[<Android.Runtime.Register("getPreferredActivities", "(Ljava/util/List;Ljava/util/List;Ljava/lang/String;)I", "GetGetPreferredActivities_Ljava_util_List_Ljava_util_List_Ljava_lang_String_Handler")>]
abstract member GetPreferredActivities : System.Collections.Generic.IList<Android.Content.IntentFilter> * System.Collections.Generic.IList<Android.Content.ComponentName> * string -> int

Parameters

outFilters
IList<IntentFilter>

A required list in which to place the filters of all of the preferred activities.

outActivities
IList<ComponentName>

A required list in which to place the component names of all of the preferred activities.

packageName
String

An optional package in which you would like to limit the list. If null, all activities will be returned; if non-null, only those activities in the given package are returned.

Returns

Int32

Returns the total number of registered preferred activities (the number of distinct IntentFilter records, not the number of unique activity components) that were found.

Attributes

Remarks

Java documentation for android.content.pm.PackageManager.getPreferredActivities(java.util.List<android.content.IntentFilter>, java.util.List<android.content.ComponentName>, java.lang.String).

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