Share via


DevicePolicyManager.CreateAndInitializeUser Method

Definition

Called by a device owner to create a user with the specified name.

[Android.Runtime.Register("createAndInitializeUser", "(Landroid/content/ComponentName;Ljava/lang/String;Ljava/lang/String;Landroid/content/ComponentName;Landroid/os/Bundle;)Landroid/os/UserHandle;", "GetCreateAndInitializeUser_Landroid_content_ComponentName_Ljava_lang_String_Ljava_lang_String_Landroid_content_ComponentName_Landroid_os_Bundle_Handler")]
public virtual Android.OS.UserHandle? CreateAndInitializeUser (Android.Content.ComponentName? admin, string? name, string? ownerName, Android.Content.ComponentName? profileOwnerComponent, Android.OS.Bundle? adminExtras);
[<Android.Runtime.Register("createAndInitializeUser", "(Landroid/content/ComponentName;Ljava/lang/String;Ljava/lang/String;Landroid/content/ComponentName;Landroid/os/Bundle;)Landroid/os/UserHandle;", "GetCreateAndInitializeUser_Landroid_content_ComponentName_Ljava_lang_String_Ljava_lang_String_Landroid_content_ComponentName_Landroid_os_Bundle_Handler")>]
abstract member CreateAndInitializeUser : Android.Content.ComponentName * string * string * Android.Content.ComponentName * Android.OS.Bundle -> Android.OS.UserHandle
override this.CreateAndInitializeUser : Android.Content.ComponentName * string * string * Android.Content.ComponentName * Android.OS.Bundle -> Android.OS.UserHandle

Parameters

admin
ComponentName

Which DeviceAdminReceiver this request is associated with.

name
String

the user's name

ownerName
String

the human readable name of the organisation associated with this DPM.

profileOwnerComponent
ComponentName

The DeviceAdminReceiver that will be an active admin on the user.

adminExtras
Bundle

Extras that will be passed to onEnable of the admin receiver on the new user.

Returns

Attributes

Remarks

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