# Print output for @column tags ?> KeyguardManager.KeyguardLock - Android SDK | Android Developers

Most visited

Recently visited

KeyguardManager.KeyguardLock

public class KeyguardManager.KeyguardLock
extends Object

java.lang.Object
   ↳ android.app.KeyguardManager.KeyguardLock


This class is deprecated.
Use LayoutParams#FLAG_DISMISS_KEYGUARD and/or LayoutParams#FLAG_SHOW_WHEN_LOCKED instead; this allows you to seamlessly hide the keyguard as your application moves in and out of the foreground and does not require that any special permissions be requested.

Handle returned by KeyguardManager#newKeyguardLock that allows you to disable / reenable the keyguard.

Summary

Public methods

void disableKeyguard()

Disable the keyguard from showing.

void reenableKeyguard()

Reenable the keyguard.

Inherited methods

Public methods

disableKeyguard

public void disableKeyguard ()

Disable the keyguard from showing. If the keyguard is currently showing, hide it. The keyguard will be prevented from showing again until reenableKeyguard() is called. A good place to call this is from Activity.onResume() Note: This call has no effect while any DevicePolicyManager is enabled that requires a password.
Requires Manifest.permission.DISABLE_KEYGUARD

See also:

reenableKeyguard

public void reenableKeyguard ()

Reenable the keyguard. The keyguard will reappear if the previous call to disableKeyguard() caused it to be hidden. A good place to call this is from Activity.onPause() Note: This call has no effect while any DevicePolicyManager is enabled that requires a password.
Requires Manifest.permission.DISABLE_KEYGUARD

See also: