This mobile phone feature allows the user to disable (lock) the keys so that a number will not accidentally be dialed while the phone is in your pocket or purse. A special key combination, unlikely to be pressed accidentally, is typically used to unlock the keys.
Questions tagged [keyguard]
147 questions
5
votes
1 answer
Activity on lockscreen - dismissing it resumes previous activity
Say my app is running normally, showing Activity A. Then the user locks the phone. A dutifully goes to sleep (onPause()). At some point while the screen is off, I need to show something to the user. So from my background code (service), I call…

Stephan Steiner
- 1,043
- 1
- 9
- 22
5
votes
0 answers
Is there a direct event for keyguard lock?
DUPLICATE WARNING: this post IS NOT about screen on/off, this post IS about keyguard lock (those issues are not the same).
Luckily there is a direct event when the keyguard is unlocked, but what about event when the keyguard is locked? I searched…

greenoldman
- 16,895
- 26
- 119
- 185
4
votes
1 answer
Application gets crashed while using KeyGuardManager below Android L
KeyGuardManager works fine above android L, but it throws exception in Android L and below.
I am using below function:
@RequiresApi(api = Build.VERSION_CODES.M)
private void createKey() {
try {
KeyStore keyStore =…

Unnati
- 2,441
- 17
- 37
4
votes
0 answers
Avoiding statusbar to expand without hiding it
I'd like to add in my app a keyguard like the one used in Go locker / MX player.
Both the apps allow you to see the statusbar but you cannot pull it down. I already found some tricks to draw over the statusbar but this is not what I'm looking…

Vlatego
- 588
- 1
- 6
- 15
4
votes
4 answers
Activity with specific height in front of lockscreen
I want to display an Activity in front of the Lockscreen. I tried with this code in my onCreate medthod:
super.onCreate(savedInstanceState);
Window window = getWindow();
window.addFlags(LayoutParams.FLAG_SHOW_WHEN_LOCKED); …

Cilenco
- 6,951
- 17
- 72
- 152
4
votes
1 answer
How to re enable keyguard after disabling?
I'm making a lock screen app that uses a foreground service which disables the keyguard when it is started and reenables it when it is destroyed. I can disable it fine, but it doesn't reenable when the service is stopped. I'm stopping the service…

CoffeeCrisp
- 253
- 3
- 6
- 19
3
votes
2 answers
android - how do i dismiss the lock screen on new android version?
i need to dismiss the default lock screen on some cases . it is possible using KeyguardManager.KeyguardLock , but it's deprecated and might not be available on the new android v4 version (ICS) .
instead , here android docs i read that i should use…

android developer
- 114,585
- 152
- 739
- 1,270
3
votes
0 answers
Full screen notifications unwantedly triggering keyguard
I'm making an app that shows full-screen notifications when the device is locked.
Expected behavior: when a notification is launched, the activity shows over the lock screen without prompting the user to unlock the device. It should be the same as…

amedev
- 31
- 2
3
votes
0 answers
Show authentication prompt with only device credential option on Android 10 and lower
I can display biometric prompt with device credentials using 'androidx.biometric:biometric:1.2.0-alpha03' as,
val promptInfo = BiometricPrompt.PromptInfo.Builder()
.setTitle("Login to My App")
.setSubtitle("Log in using your…

sneharc
- 493
- 3
- 21
3
votes
3 answers
Calling requestDismissKeyguard() twice with a delayed result
I'm working on an app that has call capabilities so I need the device to wake up. If the device is locked, I use the following code to unlock it:
keyguardManager.requestDismissKeyguard(this, new KeyguardManager.KeyguardDismissCallback() {
…

The Hungry Androider
- 2,274
- 5
- 27
- 52
3
votes
1 answer
Unlock android device not working while call ACTION_CALL intent
I am receiving a push notification, On that, calling a foreground service.
From the service, I am calling one Activity.
Here, I have 2 functionality.
1. Sound alarm for emergency
2. Call using ACTION_CALL.
Both are working fine if device…

RaRa
- 2,024
- 1
- 18
- 29
3
votes
0 answers
Callback on change Screen lock
I need some advice about Screen lock on Android.
Does android sent some intent when user change Screen lock?
Or I need poll KeyguardManager.isDeviceSecured in Service?
Google pay send a notification when user remove Screen lock, i need exactly the…

aTable
- 73
- 1
- 4
3
votes
2 answers
KeyGuard for kitkat
How to make the app get user to auth himself with the phone's PIN or whatever using KeyGuard if the phone is under SDK 21?
I want something like KeyguardManager#createConfirmDeviceCredentialIntent, but for under SDK 21.

theAnonymous
- 1,701
- 2
- 28
- 62
3
votes
0 answers
Show a transparent activity above the lock screen such that the lock screen still is visible
I have an activity which pops up everywhere (when a specific GCM message is received). Since the activity has a transparent area you still can see everything through it, depending on where you are on your Android device. It is also shown above the…

softwaresupply
- 1,908
- 3
- 20
- 34
3
votes
1 answer
Lollipop keyguard not dismissed?
I'm developing a app that in certain times it should wake up the device and dismiss the keyguard to display some activity until the user dismisses it. So, the
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD |
…

Leebeedev
- 2,126
- 22
- 31