Freigeben über


DevicePolicyManager.CreateAdminSupportIntent(String) Method

Definition

Called by any app to display a support dialog when a feature was disabled by an admin.

[Android.Runtime.Register("createAdminSupportIntent", "(Ljava/lang/String;)Landroid/content/Intent;", "GetCreateAdminSupportIntent_Ljava_lang_String_Handler", ApiSince=26)]
public virtual Android.Content.Intent? CreateAdminSupportIntent (string restriction);
[<Android.Runtime.Register("createAdminSupportIntent", "(Ljava/lang/String;)Landroid/content/Intent;", "GetCreateAdminSupportIntent_Ljava_lang_String_Handler", ApiSince=26)>]
abstract member CreateAdminSupportIntent : string -> Android.Content.Intent
override this.CreateAdminSupportIntent : string -> Android.Content.Intent

Parameters

restriction
String

Indicates for which feature the dialog should be displayed. Can be a user restriction from UserManager, e.g. UserManager#DISALLOW_ADJUST_VOLUME, or one of the constants #POLICY_DISABLE_CAMERA or #POLICY_DISABLE_SCREEN_CAPTURE.

Returns

Intent An intent to be used to start the dialog-activity if the restriction is set by an admin, or null if the restriction does not exist or no admin set it.

Attributes

Remarks

Called by any app to display a support dialog when a feature was disabled by an admin. This returns an intent that can be used with Context#startActivity(Intent) to display the dialog. It will tell the user that the feature indicated by restriction was disabled by an admin, and include a link for more information. The default content of the dialog can be changed by the restricting admin via #setShortSupportMessage(ComponentName, CharSequence). If the restriction is not set (i.e. the feature is available), then the return value will be null.

Java documentation for android.app.admin.DevicePolicyManager.createAdminSupportIntent(java.lang.String).

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