Most visited

Recently visited

Added in API level 1

ResolveInfo

public class ResolveInfo
extends Object implements Parcelable

java.lang.Object
   ↳ android.content.pm.ResolveInfo


Information that is returned from resolving an intent against an IntentFilter. This partially corresponds to information collected from the AndroidManifest.xml's <intent> tags.

Summary

Nested classes

class ResolveInfo.DisplayNameComparator

 

Inherited constants

From interface android.os.Parcelable

Fields

public static final Creator<ResolveInfo> CREATOR

public ActivityInfo activityInfo

The activity or broadcast receiver that corresponds to this resolution match, if this resolution is for an activity or broadcast receiver.

public IntentFilter filter

The IntentFilter that was matched for this ResolveInfo.

public int icon

A drawable resource identifier (in the package's resources) of this match's icon.

public boolean isDefault

This filter has specified the Intent.CATEGORY_DEFAULT, meaning it would like to be considered a default action that the user can perform on this data.

public int labelRes

A string resource identifier (in the package's resources) of this match's label.

public int match

The system's evaluation of how well the activity matches the IntentFilter.

public CharSequence nonLocalizedLabel

The actual string retrieve from labelRes or null if none was provided.

public int preferredOrder

Order of result according to the user's preference.

public int priority

The declared priority of this match.

public ProviderInfo providerInfo

The provider that corresponds to this resolution match, if this resolution is for a provider.

public String resolvePackageName

Optional -- if non-null, the labelRes and icon resources will be loaded from this package, rather than the one containing the resolved component.

public ServiceInfo serviceInfo

The service that corresponds to this resolution match, if this resolution is for a service.

public int specificIndex

Only set when returned by queryIntentActivityOptions(ComponentName, Intent[], Intent, int), this tells you which of the given specific intents this result came from.

Public constructors

ResolveInfo()
ResolveInfo(ResolveInfo orig)

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

void dump(Printer pw, String prefix)
final int getIconResource()

Return the icon resource identifier to use for this match.

Drawable loadIcon(PackageManager pm)

Retrieve the current graphical icon associated with this resolution.

CharSequence loadLabel(PackageManager pm)

Retrieve the current textual label associated with this resolution.

String toString()

Returns a string representation of the object.

void writeToParcel(Parcel dest, int parcelableFlags)

Flatten this object in to a Parcel.

Inherited methods

From class java.lang.Object
From interface android.os.Parcelable

Fields

CREATOR

Added in API level 1
Creator<ResolveInfo> CREATOR

activityInfo

Added in API level 1
ActivityInfo activityInfo

The activity or broadcast receiver that corresponds to this resolution match, if this resolution is for an activity or broadcast receiver. Exactly one of activityInfo, serviceInfo, or providerInfo will be non-null.

filter

Added in API level 1
IntentFilter filter

The IntentFilter that was matched for this ResolveInfo.

icon

Added in API level 1
int icon

A drawable resource identifier (in the package's resources) of this match's icon. From the "icon" attribute or, if not set, 0. It is set only if the icon can be obtained by resource id alone.

isDefault

Added in API level 1
boolean isDefault

This filter has specified the Intent.CATEGORY_DEFAULT, meaning it would like to be considered a default action that the user can perform on this data.

labelRes

Added in API level 1
int labelRes

A string resource identifier (in the package's resources) of this match's label. From the "label" attribute or, if not set, 0.

match

Added in API level 1
int match

The system's evaluation of how well the activity matches the IntentFilter. This is a match constant, a combination of IntentFilter.MATCH_CATEGORY_MASK and IntentFiler.MATCH_ADJUSTMENT_MASK.

nonLocalizedLabel

Added in API level 1
CharSequence nonLocalizedLabel

The actual string retrieve from labelRes or null if none was provided.

preferredOrder

Added in API level 1
int preferredOrder

Order of result according to the user's preference. If the user has not set a preference for this result, the value is 0; higher values are a higher priority.

priority

Added in API level 1
int priority

The declared priority of this match. Comes from the "priority" attribute or, if not set, defaults to 0. Higher values are a higher priority.

providerInfo

Added in API level 19
ProviderInfo providerInfo

The provider that corresponds to this resolution match, if this resolution is for a provider. Exactly one of activityInfo, serviceInfo, or providerInfo will be non-null.

resolvePackageName

Added in API level 5
String resolvePackageName

Optional -- if non-null, the labelRes and icon resources will be loaded from this package, rather than the one containing the resolved component.

serviceInfo

Added in API level 1
ServiceInfo serviceInfo

The service that corresponds to this resolution match, if this resolution is for a service. Exactly one of activityInfo, serviceInfo, or providerInfo will be non-null.

specificIndex

Added in API level 1
int specificIndex

Only set when returned by queryIntentActivityOptions(ComponentName, Intent[], Intent, int), this tells you which of the given specific intents this result came from. 0 is the first in the list, < 0 means it came from the generic Intent query.

Public constructors

ResolveInfo

Added in API level 1
ResolveInfo ()

ResolveInfo

Added in API level 17
ResolveInfo (ResolveInfo orig)

Parameters
orig ResolveInfo

Public methods

describeContents

Added in API level 1
int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

dump

Added in API level 1
void dump (Printer pw, 
                String prefix)

Parameters
pw Printer
prefix String

getIconResource

Added in API level 1
int getIconResource ()

Return the icon resource identifier to use for this match. If the match defines an icon, that is used; else if the activity defines an icon, that is used; else, the application icon is used.

Returns
int The icon associated with this match.

loadIcon

Added in API level 1
Drawable loadIcon (PackageManager pm)

Retrieve the current graphical icon associated with this resolution. This will call back on the given PackageManager to load the icon from the application.

Parameters
pm PackageManager: A PackageManager from which the icon can be loaded; usually the PackageManager from which you originally retrieved this item.
Returns
Drawable Returns a Drawable containing the resolution's icon. If the item does not have an icon, the default activity icon is returned.

loadLabel

Added in API level 1
CharSequence loadLabel (PackageManager pm)

Retrieve the current textual label associated with this resolution. This will call back on the given PackageManager to load the label from the application.

Parameters
pm PackageManager: A PackageManager from which the label can be loaded; usually the PackageManager from which you originally retrieved this item.
Returns
CharSequence Returns a CharSequence containing the resolutions's label. If the item does not have a label, its name is returned.

toString

Added in API level 1
String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
String a string representation of the object.

writeToParcel

Added in API level 1
void writeToParcel (Parcel dest, 
                int parcelableFlags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written.
parcelableFlags int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.

Hooray!