PackageManager.GetPreferredActivities 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.
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
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
Retrieve all preferred activities, previously added with #addPreferredActivity
, that are currently registered with the system.
This member is deprecated. This function no longer does anything. It is the platform's responsibility to assign preferred activities and this cannot be modified directly. To determine the activities resolved by the platform, use #resolveActivity
or #queryIntentActivities
. To configure an app to be responsible for a particular role and to check current role holders, see android.app.role.RoleManager
.
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.