Language

KeyguardManager.RequestDismissKeyguard Method

Definition

Requests that the Keyguard (lock screen) be dismissed if it is currently showing.

[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

Activity: The activity requesting the dismissal. The activity must either be visible by using R.attr.showWhenLocked or Activity.setShowWhenLocked(boolean), 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. This value cannot be null.

callback
KeyguardManager.KeyguardDismissCallback

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

Requests that the Keyguard (lock screen) be dismissed if it is currently showing. If the Keyguard is not secure or the device is currently in a trusted state, calling this method will immediately dismiss the Keyguard without any user interaction. If the Keyguard is secure and the device is not in a trusted state, this will bring up the UI so the user can enter their credentials. If the value set for the Activity attr R.attr.turnScreenOn is true, the screen will turn on when the keyguard is dismissed.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-08-03 UTC.

Android reference for android.app.KeyguardManager.requestDismissKeyguard.

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