Share via


DeviceAdminReceiver.OnDisableRequested(Context, Intent) Method

Definition

Called when the user has asked to disable the administrator, as a result of receiving #ACTION_DEVICE_ADMIN_DISABLE_REQUESTED, giving you a chance to present a warning message to them.

public string? OnDisableRequested (Android.Content.Context context, Android.Content.Intent intent);
member this.OnDisableRequested : Android.Content.Context * Android.Content.Intent -> string

Parameters

context
Context

The running context as per #onReceive.

intent
Intent

The received intent as per #onReceive.

Returns

Return the warning message to display to the user before being disabled; if null is returned, no message is displayed.

Remarks

Called when the user has asked to disable the administrator, as a result of receiving #ACTION_DEVICE_ADMIN_DISABLE_REQUESTED, giving you a chance to present a warning message to them. The message is returned as the result; if null is returned (the default implementation), no message will be displayed.

Java documentation for android.app.admin.DeviceAdminReceiver.onDisableRequested(android.content.Context, android.content.Intent).

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