Share via


DevicePolicyManager.SwitchUser(ComponentName, UserHandle) Method

Definition

Called by a device owner to switch the specified secondary user to the foreground.

[Android.Runtime.Register("switchUser", "(Landroid/content/ComponentName;Landroid/os/UserHandle;)Z", "GetSwitchUser_Landroid_content_ComponentName_Landroid_os_UserHandle_Handler")]
public virtual bool SwitchUser (Android.Content.ComponentName admin, Android.OS.UserHandle? userHandle);
[<Android.Runtime.Register("switchUser", "(Landroid/content/ComponentName;Landroid/os/UserHandle;)Z", "GetSwitchUser_Landroid_content_ComponentName_Landroid_os_UserHandle_Handler")>]
abstract member SwitchUser : Android.Content.ComponentName * Android.OS.UserHandle -> bool
override this.SwitchUser : Android.Content.ComponentName * Android.OS.UserHandle -> bool

Parameters

admin
ComponentName

Which DeviceAdminReceiver this request is associated with.

userHandle
UserHandle

the user to switch to; null will switch to primary.

Returns

true if the switch was successful, false otherwise.

Attributes

Remarks

Called by a device owner to switch the specified secondary user to the foreground.

Java documentation for android.app.admin.DevicePolicyManager.switchUser(android.content.ComponentName, 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

See also