Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/content/pm/LauncherActivityInfo#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/content/pm/LauncherActivityInfo#inhmethods)

# LauncherActivityInfo

*** ** * ** ***


`
public


class
LauncherActivityInfo
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.content.pm.LauncherActivityInfo |

<br />

*** ** * ** ***

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 ||
|---|---|
| ` https://developer.android.com/reference/android/content/pm/ActivityInfo` | ` https://developer.android.com/reference/android/content/pm/LauncherActivityInfo#getActivityInfo()() ` Returns the ActivityInfo of the activity. |
| ` https://developer.android.com/reference/android/content/pm/ApplicationInfo` | ` https://developer.android.com/reference/android/content/pm/LauncherActivityInfo#getApplicationInfo()() ` Returns the application info for the application this activity belongs to. |
| ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/content/pm/LauncherActivityInfo#getBadgedIcon(int)(int density) ` Returns the activity icon with badging appropriate for the profile. |
| ` https://developer.android.com/reference/android/content/ComponentName` | ` https://developer.android.com/reference/android/content/pm/LauncherActivityInfo#getComponentName()() ` Returns the component name of this activity. |
| ` long` | ` https://developer.android.com/reference/android/content/pm/LauncherActivityInfo#getFirstInstallTime()() ` Returns the time at which the package was first installed. |
| ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/content/pm/LauncherActivityInfo#getIcon(int)(int density) ` Returns the icon for this activity, without any badging for the profile. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/content/pm/LauncherActivityInfo#getLabel()() ` Retrieves the label for the activity. |
| ` float` | ` https://developer.android.com/reference/android/content/pm/LauncherActivityInfo#getLoadingProgress()() ` |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/pm/LauncherActivityInfo#getName()() ` Returns the name for the activity from android:name in the manifest. |
| ` https://developer.android.com/reference/android/os/UserHandle` | ` https://developer.android.com/reference/android/content/pm/LauncherActivityInfo#getUser()() ` Returns the user handle of the user profile that this activity belongs to. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Public methods

### getActivityInfo

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ActivityInfo getActivityInfo ()
```

Returns the ActivityInfo of the activity.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/pm/ActivityInfo` | Activity Info. This value cannot be `null`. <br /> |

### getApplicationInfo

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ApplicationInfo getApplicationInfo ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/pm/ApplicationInfo` | <br /> |

### getBadgedIcon

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Drawable getBadgedIcon (int density)
```

Returns the activity icon with badging appropriate for the profile.

<br />

| Parameters ||
|---|---|
| `density` | `int`: Optional density for the icon, or 0 to use the default density. Use `https://developer.android.com/reference/android/util/DisplayMetrics` for DPI values. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | A badged icon for the activity. <br /> |

**See also:**

- `https://developer.android.com/reference/android/util/DisplayMetrics`

### getComponentName

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ComponentName getComponentName ()
```

Returns the component name of this activity.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/ComponentName` | ComponentName of the activity <br /> |

### getFirstInstallTime

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getFirstInstallTime ()
```

Returns the time at which the package was first installed.

<br />

| Returns ||
|---|---|
| `long` | The time of installation of the package, in milliseconds. <br /> |

### getIcon

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Drawable getIcon (int density)
```

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

The returned drawable is subject to the same size capping limits as described
in `https://developer.android.com/reference/android/content/pm/PackageManager#getApplicationIcon(android.content.pm.ApplicationInfo)`.

<br />

<br />

| Parameters ||
|---|---|
| `density` | `int`: The preferred density of the icon, zero for default density. Use density DPI values from `https://developer.android.com/reference/android/util/DisplayMetrics`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | The drawable associated with the activity. <br /> |

**See also:**

- `https://developer.android.com/reference/android/content/pm/LauncherActivityInfo#getBadgedIcon(int)`
- `https://developer.android.com/reference/android/util/DisplayMetrics`

### getLabel

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CharSequence getLabel ()
```

Retrieves the label for the activity. If the activity's label is invisible
for the user, use the application's label instead. If the application's label
is still invisible for the user, use the package name instead.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | The label for the activity. If the activity's label is invisible for the user, return the application's label instead. If the application's label is still invisible for the user, return the package name instead. <br /> |

### getLoadingProgress

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getLoadingProgress ()
```

<br />

<br />

| Returns ||
|---|---|
| `float` | Package loading progress, range between \[0, 1\]. Value is between 0.0f and 1.0f inclusive <br /> |

### getName

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getName ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the name from android:name for the activity. <br /> |

### getUser

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/UserHandle` | The UserHandle of the profile. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/UserManager#getSerialNumberForUser(android.os.UserHandle)`
- `https://developer.android.com/reference/android/os/UserManager#getUserForSerialNumber(long)`