Skip to content

Most visited

Recently visited

navigation

LauncherActivityInfo

public class LauncherActivityInfo
extends Object

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


A representation of an activity that can belong to this user or a managed profile associated with this user. It can be used to query the label, icon and badged icon for the activity.

Summary

Public methods

ApplicationInfo getApplicationInfo()

Returns the application info for the appliction this activity belongs to.

Drawable getBadgedIcon(int density)

Returns the activity icon with badging appropriate for the profile.

ComponentName getComponentName()

Returns the component name of this activity.

long getFirstInstallTime()

Returns the time at which the package was first installed.

Drawable getIcon(int density)

Returns the icon for this activity, without any badging for the profile.

CharSequence getLabel()

Retrieves the label for the activity.

String getName()

Returns the name for the acitivty from android:name in the manifest.

UserHandle getUser()

Returns the user handle of the user profile that this activity belongs to.

Inherited methods

From class java.lang.Object

Public methods

getApplicationInfo

added in API level 21
ApplicationInfo getApplicationInfo ()

Returns the application info for the appliction this activity belongs to.

Returns
ApplicationInfo

getBadgedIcon

added in API level 21
Drawable getBadgedIcon (int density)

Returns the activity icon with badging appropriate for the profile.

Parameters
density int: Optional density for the icon, or 0 to use the default density. Use DisplayMetrics for DPI values.

Returns
Drawable A badged icon for the activity.

See also:

getComponentName

added in API level 21
ComponentName getComponentName ()

Returns the component name of this activity.

Returns
ComponentName ComponentName of the activity

getFirstInstallTime

added in API level 21
long getFirstInstallTime ()

Returns the time at which the package was first installed.

Returns
long The time of installation of the package, in milliseconds.

getIcon

added in API level 21
Drawable getIcon (int density)

Returns the icon for this activity, without any badging for the profile.

Parameters
density int: The preferred density of the icon, zero for default density. Use density DPI values from DisplayMetrics.

Returns
Drawable The drawable associated with the activity.

See also:

getLabel

added in API level 21
CharSequence getLabel ()

Retrieves the label for the activity.

Returns
CharSequence The label for the activity.

getName

added in API level 21
String getName ()

Returns the name for the acitivty from android:name in the manifest.

Returns
String the name from android:name for the acitivity.

getUser

added in API level 21
UserHandle getUser ()

Returns the user handle of the user profile that this activity belongs to. In order to persist the identity of the profile, do not store the UserHandle. Instead retrieve its serial number from UserManager. You can convert the serial number back to a UserHandle for later use.

Returns
UserHandle The UserHandle of the profile.

See also:

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)