Udostępnij za pośrednictwem


LauncherApps.Callback.OnPackagesSuspended Method

Definition

Overloads

OnPackagesSuspended(String[], UserHandle)

Indicates that one or more packages have been suspended.

OnPackagesSuspended(String[], UserHandle, Bundle)

Indicates that one or more packages have been suspended.

OnPackagesSuspended(String[], UserHandle)

Indicates that one or more packages have been suspended.

[Android.Runtime.Register("onPackagesSuspended", "([Ljava/lang/String;Landroid/os/UserHandle;)V", "GetOnPackagesSuspended_arrayLjava_lang_String_Landroid_os_UserHandle_Handler", ApiSince=24)]
public virtual void OnPackagesSuspended (string[]? packageNames, Android.OS.UserHandle? user);
[<Android.Runtime.Register("onPackagesSuspended", "([Ljava/lang/String;Landroid/os/UserHandle;)V", "GetOnPackagesSuspended_arrayLjava_lang_String_Landroid_os_UserHandle_Handler", ApiSince=24)>]
abstract member OnPackagesSuspended : string[] * Android.OS.UserHandle -> unit
override this.OnPackagesSuspended : string[] * Android.OS.UserHandle -> unit

Parameters

packageNames
String[]

The names of the packages that have just been suspended.

user
UserHandle

The UserHandle of the profile that generated the change.

Attributes

Remarks

Indicates that one or more packages have been suspended. For example, this can happen when a Device Administrator suspends an applicaton.

Note: On devices running android.os.Build.VERSION_CODES#P Android P or higher, any apps that override #onPackagesSuspended(String[], UserHandle, Bundle) will not receive this callback.

Java documentation for android.content.pm.LauncherApps.Callback.onPackagesSuspended(java.lang.String[], android.os.UserHandle).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

OnPackagesSuspended(String[], UserHandle, Bundle)

Indicates that one or more packages have been suspended.

[Android.Runtime.Register("onPackagesSuspended", "([Ljava/lang/String;Landroid/os/UserHandle;Landroid/os/Bundle;)V", "GetOnPackagesSuspended_arrayLjava_lang_String_Landroid_os_UserHandle_Landroid_os_Bundle_Handler", ApiSince=28)]
public virtual void OnPackagesSuspended (string[]? packageNames, Android.OS.UserHandle? user, Android.OS.Bundle? launcherExtras);
[<Android.Runtime.Register("onPackagesSuspended", "([Ljava/lang/String;Landroid/os/UserHandle;Landroid/os/Bundle;)V", "GetOnPackagesSuspended_arrayLjava_lang_String_Landroid_os_UserHandle_Landroid_os_Bundle_Handler", ApiSince=28)>]
abstract member OnPackagesSuspended : string[] * Android.OS.UserHandle * Android.OS.Bundle -> unit
override this.OnPackagesSuspended : string[] * Android.OS.UserHandle * Android.OS.Bundle -> unit

Parameters

packageNames
String[]

The names of the packages that have just been suspended.

user
UserHandle

the user for which the given packages were suspended.

launcherExtras
Bundle

A Bundle of extras for the launcher, if provided to the system, null otherwise.

Attributes

Remarks

Indicates that one or more packages have been suspended. A device administrator or an app with android.permission.SUSPEND_APPS can do this.

A suspending app with the permission android.permission.SUSPEND_APPS can optionally provide a Bundle of extra information that it deems helpful for the launcher to handle the suspended state of these packages. The contents of this Bundle are supposed to be a contract between the suspending app and the launcher.

This member is deprecated. launcherExtras should be obtained by using #getSuspendedPackageLauncherExtras(String, UserHandle). For all other cases, #onPackagesSuspended(String[], UserHandle) should be used.

Java documentation for android.content.pm.LauncherApps.Callback.onPackagesSuspended(java.lang.String[], android.os.UserHandle, android.os.Bundle).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to