Freigeben über


UserManager.IsUserRunningOrStopping(UserHandle) Method

Definition

Return whether the given user is actively running <em>or</em> stopping.

[Android.Runtime.Register("isUserRunningOrStopping", "(Landroid/os/UserHandle;)Z", "GetIsUserRunningOrStopping_Landroid_os_UserHandle_Handler")]
public virtual bool IsUserRunningOrStopping (Android.OS.UserHandle? user);
[<Android.Runtime.Register("isUserRunningOrStopping", "(Landroid/os/UserHandle;)Z", "GetIsUserRunningOrStopping_Landroid_os_UserHandle_Handler")>]
abstract member IsUserRunningOrStopping : Android.OS.UserHandle -> bool
override this.IsUserRunningOrStopping : Android.OS.UserHandle -> bool

Parameters

user
UserHandle

The user to retrieve the running state for.

Returns

Attributes

Remarks

Return whether the given user is actively running <em>or</em> stopping. This is like #isUserRunning(UserHandle), but will also return true if the user had been running but is in the process of being stopped (but is not yet fully stopped, and still running some code).

Note prior to Android Nougat MR1 (SDK version <= 24; android.os.Build.VERSION_CODES#N, this API required a system permission in order to check other profile's status. Since Android Nougat MR1 (SDK version >= 25; android.os.Build.VERSION_CODES#N_MR1), the restriction has been relaxed, and now it'll accept any android.os.UserHandle within the same profile group as the caller.

Java documentation for android.os.UserManager.isUserRunningOrStopping(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