DeviceAdminReceiver.OnEnabled(Context, Intent) 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 after the administrator is first enabled, as a result of
receiving #ACTION_DEVICE_ADMIN_ENABLED
.
[Android.Runtime.Register("onEnabled", "(Landroid/content/Context;Landroid/content/Intent;)V", "GetOnEnabled_Landroid_content_Context_Landroid_content_Intent_Handler")]
public virtual void OnEnabled (Android.Content.Context context, Android.Content.Intent intent);
[<Android.Runtime.Register("onEnabled", "(Landroid/content/Context;Landroid/content/Intent;)V", "GetOnEnabled_Landroid_content_Context_Landroid_content_Intent_Handler")>]
abstract member OnEnabled : Android.Content.Context * Android.Content.Intent -> unit
override this.OnEnabled : Android.Content.Context * Android.Content.Intent -> unit
Parameters
- context
- Context
The running context as per #onReceive
.
- intent
- Intent
The received intent as per #onReceive
.
- Attributes
Remarks
Called after the administrator is first enabled, as a result of receiving #ACTION_DEVICE_ADMIN_ENABLED
. At this point you can use DevicePolicyManager
to set your desired policies.
If the admin is activated by a device owner, then the intent may contain private extras that are relevant to user setup. DevicePolicyManager#createAndManageUser(ComponentName, String, ComponentName, PersistableBundle, int)
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.