Android APIs
public class

LauncherActivityInfo

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

Class Overview

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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public ApplicationInfo getApplicationInfo ()

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

public Drawable getBadgedIcon (int density)

Returns the activity icon with badging appropriate for the profile.

Parameters
density Optional density for the icon, or 0 to use the default density. Use DisplayMetrics for DPI values.
Returns
  • A badged icon for the activity.
See Also

public ComponentName getComponentName ()

Returns the component name of this activity.

Returns
  • ComponentName of the activity

public long getFirstInstallTime ()

Returns the time at which the package was first installed.

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

public Drawable getIcon (int density)

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

Parameters
density The preferred density of the icon, zero for default density. Use density DPI values from DisplayMetrics.
Returns
  • The drawable associated with the activity

public CharSequence getLabel ()

Retrieves the label for the activity.

Returns
  • The label for the activity.

public String getName ()

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

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

public 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
  • The UserHandle of the profile.