Partager via


KeyguardManager.RequestDismissKeyguard Method

Definition

If the device is currently locked (see #isKeyguardLocked(), requests the Keyguard to be dismissed.

[Android.Runtime.Register("requestDismissKeyguard", "(Landroid/app/Activity;Landroid/app/KeyguardManager$KeyguardDismissCallback;)V", "GetRequestDismissKeyguard_Landroid_app_Activity_Landroid_app_KeyguardManager_KeyguardDismissCallback_Handler", ApiSince=26)]
public virtual void RequestDismissKeyguard (Android.App.Activity activity, Android.App.KeyguardManager.KeyguardDismissCallback? callback);
[<Android.Runtime.Register("requestDismissKeyguard", "(Landroid/app/Activity;Landroid/app/KeyguardManager$KeyguardDismissCallback;)V", "GetRequestDismissKeyguard_Landroid_app_Activity_Landroid_app_KeyguardManager_KeyguardDismissCallback_Handler", ApiSince=26)>]
abstract member RequestDismissKeyguard : Android.App.Activity * Android.App.KeyguardManager.KeyguardDismissCallback -> unit
override this.RequestDismissKeyguard : Android.App.Activity * Android.App.KeyguardManager.KeyguardDismissCallback -> unit

Parameters

activity
Activity

The activity requesting the dismissal. The activity must be either visible by using LayoutParams#FLAG_SHOW_WHEN_LOCKED or must be in a state in which it would be visible if Keyguard would not be hiding it. If that's not the case, the request will fail immediately and KeyguardDismissCallback#onDismissError will be invoked.

callback
KeyguardManager.KeyguardDismissCallback

The callback to be called if the request to dismiss Keyguard was successful or null if the caller isn't interested in knowing the result. The callback will not be invoked if the activity was destroyed before the callback was received.

Attributes

Remarks

Java documentation for android.app.KeyguardManager.requestDismissKeyguard(android.app.Activity, android.app.KeyguardDismissCallback).

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