Android APIs
public static abstract class

LauncherApps.Callback

extends Object
java.lang.Object
   ↳ android.content.pm.LauncherApps.Callback

Class Overview

Callbacks for package changes to this and related managed profiles.

Summary

Public Constructors
LauncherApps.Callback()
Public Methods
abstract void onPackageAdded(String packageName, UserHandle user)
Indicates that a package was added to the specified profile.
abstract void onPackageChanged(String packageName, UserHandle user)
Indicates that a package was modified in the specified profile.
abstract void onPackageRemoved(String packageName, UserHandle user)
Indicates that a package was removed from the specified profile.
abstract void onPackagesAvailable(String[] packageNames, UserHandle user, boolean replacing)
Indicates that one or more packages have become available.
abstract void onPackagesUnavailable(String[] packageNames, UserHandle user, boolean replacing)
Indicates that one or more packages have become unavailable.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public LauncherApps.Callback ()

Added in API level 21

Public Methods

public abstract void onPackageAdded (String packageName, UserHandle user)

Added in API level 21

Indicates that a package was added to the specified profile. If a package is added while being updated then onPackageChanged will be called instead.

Parameters
packageName The name of the package that was added.
user The UserHandle of the profile that generated the change.

public abstract void onPackageChanged (String packageName, UserHandle user)

Added in API level 21

Indicates that a package was modified in the specified profile. This can happen, for example, when the package is updated or when one or more components are enabled or disabled.

Parameters
packageName The name of the package that has changed.
user The UserHandle of the profile that generated the change.

public abstract void onPackageRemoved (String packageName, UserHandle user)

Added in API level 21

Indicates that a package was removed from the specified profile. If a package is removed while being updated onPackageChanged will be called instead.

Parameters
packageName The name of the package that was removed.
user The UserHandle of the profile that generated the change.

public abstract void onPackagesAvailable (String[] packageNames, UserHandle user, boolean replacing)

Added in API level 21

Indicates that one or more packages have become available. For example, this can happen when a removable storage card has reappeared.

Parameters
packageNames The names of the packages that have become available.
user The UserHandle of the profile that generated the change.
replacing Indicates whether these packages are replacing existing ones.

public abstract void onPackagesUnavailable (String[] packageNames, UserHandle user, boolean replacing)

Added in API level 21

Indicates that one or more packages have become unavailable. For example, this can happen when a removable storage card has been removed.

Parameters
packageNames The names of the packages that have become unavailable.
user The UserHandle of the profile that generated the change.
replacing Indicates whether the packages are about to be replaced with new versions.