Most visited

Recently visited

Added in API level 21

LauncherApps.Callback

public static abstract class LauncherApps.Callback
extends Object

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


对此包和相关托管配置文件进行软件包更改的回调。

Summary

Public constructors

LauncherApps.Callback()

Public methods

abstract void onPackageAdded(String packageName, UserHandle user)

表示已将包添加到指定的配置文件。

abstract void onPackageChanged(String packageName, UserHandle user)

表示在指定的配置文件中修改了包。

abstract void onPackageRemoved(String packageName, UserHandle user)

表示包已从指定的配置文件中删除。

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

表示一个或多个软件包已可用。

void onPackagesSuspended(String[] packageNames, UserHandle user)

表示一个或多个软件包已被暂停。

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

表示一个或多个软件包已变得不可用。

void onPackagesUnsuspended(String[] packageNames, UserHandle user)

表示一个或多个软件包已被取消暂停。

Inherited methods

From class java.lang.Object

Public constructors

LauncherApps.Callback

Added in API level 21
LauncherApps.Callback ()

Public methods

onPackageAdded

Added in API level 21
void onPackageAdded (String packageName, 
                UserHandle user)

表示已将包添加到指定的配置文件。 如果在更新包的同时更新onPackageChanged将被调用。

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

onPackageChanged

Added in API level 21
void onPackageChanged (String packageName, 
                UserHandle user)

表示在指定的配置文件中修改了包。 例如,更新软件包或启用或禁用一个或多个组件时,可能会发生这种情况。

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

onPackageRemoved

Added in API level 21
void onPackageRemoved (String packageName, 
                UserHandle user)

表示包已从指定的配置文件中删除。 如果在更新onpackageChanged时删除了一个包,而不是调用它。

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

onPackagesAvailable

Added in API level 21
void onPackagesAvailable (String[] packageNames, 
                UserHandle user, 
                boolean replacing)

表示一个或多个软件包已可用。 例如,当可移动存储卡重新出现时,可能会发生这种情况。

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

onPackagesSuspended

Added in API level 24
void onPackagesSuspended (String[] packageNames, 
                UserHandle user)

表示一个或多个软件包已被暂停。 例如,当设备管理员暂停应用程序时可能会发生这种情况。

Parameters
packageNames String: The names of the packages that have just been suspended.
user UserHandle: The UserHandle of the profile that generated the change.

onPackagesUnavailable

Added in API level 21
void onPackagesUnavailable (String[] packageNames, 
                UserHandle user, 
                boolean replacing)

表示一个或多个软件包已变得不可用。 例如,当可移动存储卡被移除时,可能会发生这种情况。

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

onPackagesUnsuspended

Added in API level 24
void onPackagesUnsuspended (String[] packageNames, 
                UserHandle user)

表示一个或多个软件包已被取消暂停。 例如,当设备管理员取消应用程序时会发生这种情况。

Parameters
packageNames String: The names of the packages that have just been unsuspended.
user UserHandle: The UserHandle of the profile that generated the change.

Hooray!