DevicePolicyManager.SwitchUser(ComponentName, UserHandle) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
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.