Added in API level 21

LauncherActivityInfo

open class LauncherActivityInfo
kotlin.Any
   ↳ 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
open ActivityInfo

Returns the ActivityInfo of the activity.

open ApplicationInfo!

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

open Drawable!
getBadgedIcon(density: Int)

Returns the activity icon with badging appropriate for the profile.

open ComponentName!

Returns the component name of this activity.

open Long

Returns the time at which the package was first installed.

open Drawable!
getIcon(density: Int)

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

open CharSequence!

Retrieves the label for the activity.

open Float

open String!

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

open UserHandle!

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

Public methods

getActivityInfo

Added in API level 31
open fun getActivityInfo(): ActivityInfo

Returns the ActivityInfo of the activity.

Return
ActivityInfo Activity Info This value cannot be null.

getApplicationInfo

Added in API level 21
open fun getApplicationInfo(): ApplicationInfo!

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

Return
ApplicationInfo!

getBadgedIcon

Added in API level 21
open fun getBadgedIcon(density: Int): Drawable!

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.
Return
Drawable! A badged icon for the activity.

getComponentName

Added in API level 21
open fun getComponentName(): ComponentName!

Returns the component name of this activity.

Return
ComponentName! ComponentName of the activity

getFirstInstallTime

Added in API level 21
open fun getFirstInstallTime(): Long

Returns the time at which the package was first installed.

Return
Long The time of installation of the package, in milliseconds.

getIcon

Added in API level 21
open fun getIcon(density: Int): Drawable!

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.
Return
Drawable! The drawable associated with the activity.

getLabel

Added in API level 21
open fun getLabel(): CharSequence!

Retrieves the label for the activity.

Return
CharSequence! The label for the activity.

getLoadingProgress

Added in API level 31
open fun getLoadingProgress(): Float
Return
Float Package loading progress, range between [0, 1]. Value is between 0.0 and 1.0 inclusive

getName

Added in API level 21
open fun getName(): String!

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

Return
String! the name from android:name for the activity.

getUser

Added in API level 21
open fun getUser(): UserHandle!

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.

Return
UserHandle! The UserHandle of the profile.