PackageManager.ResolveActivity(Intent, PackageInfoFlags) Method

Definition

Determine the best action to perform for a given Intent.

[Android.Runtime.Register("resolveActivity", "(Landroid/content/Intent;I)Landroid/content/pm/ResolveInfo;", "GetResolveActivity_Landroid_content_Intent_IHandler")]
public abstract Android.Content.PM.ResolveInfo? ResolveActivity (Android.Content.Intent intent, Android.Content.PM.PackageInfoFlags flags);
[<Android.Runtime.Register("resolveActivity", "(Landroid/content/Intent;I)Landroid/content/pm/ResolveInfo;", "GetResolveActivity_Landroid_content_Intent_IHandler")>]
abstract member ResolveActivity : Android.Content.Intent * Android.Content.PM.PackageInfoFlags -> Android.Content.PM.ResolveInfo

Parameters

intent
Intent

An intent containing all of the desired specification (action, data, type, category, and/or component).

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

ResolveInfo

Returns a ResolveInfo object containing the final activity intent that was determined to be the best action. Returns null if no matching activity was found. If multiple matching activities are found and there is no default set, returns a ResolveInfo object containing something else, such as the activity resolver.

Attributes

Remarks

Java documentation for android.content.pm.PackageManager.resolveActivity(android.content.Intent, int).

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