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
83
votes
4 answers
What is the keyguard in Android?
I googled it and couldn't find a definition. As usual the Android documentation was very "illuminating".

U Avalos
- 6,538
- 7
- 48
- 81
47
votes
1 answer
Android - Wake Up and Unlock Device
Application description:
The application is intended as a safety program for a specific client (not to be deployed publicly). When the application has not detected movement for a certain period of time, the application should sound an alarm and…

Paul Richter
- 10,908
- 10
- 52
- 85
14
votes
1 answer
What's the difference between isDeviceLocked and isKeyguardSecure in android's KeyguardManager?
Below is excerpted from http://developer.android.com/reference/android/app/KeyguardManager.html
public boolean isDeviceLocked ()
Returns whether the device is currently locked and requires a PIN, pattern or password to unlock. Returns true if…

xmllmx
- 39,765
- 26
- 162
- 323
12
votes
1 answer
isKeyguardLocked vs isDeviceLocked
I'm currently facing a troublesome bug with some Android Devices. I'm checking up on KeyguardManager to see if I need to disable audio or not (I want the audio be disabled whenever the game is not active or screen is locked etc.)
I've been using…

Habba
- 1,179
- 2
- 13
- 32
12
votes
1 answer
Unlock the Screen Programmatically
I have a share button in the GCM notification. On click of the share button, I need to launch share intent. Everything works perfectly. Only problem that I'm facing is Lollipop lock screen feature. When I click share button from lock screen, my…

Sangeetha Pinto
- 1,022
- 3
- 14
- 32
12
votes
1 answer
Disabled Keyguard Lock re-enables itself after clicking on a notification
In my application I disable the keyguard lock (i.e.Remove Lockscreen) using the code below and it works fine until I click on any notification in the notification bar. If I click on a notification the lock screen is automatically re-enabled. Any…

Jasjit Singh Marwah
- 730
- 8
- 31
11
votes
1 answer
MIUI Permission Denied Activity KeyguardLocked
When application is in background and screen is locked,I'm unable to start activity, there is no exception or warning, onCreate() is just not called. I've been struggling against this problem for while, and I think I've finally found the source of…

Danil.B
- 880
- 1
- 11
- 23
10
votes
3 answers
How to lock/unlock phone programmatically : Android
In my application, I need to lock and unlock phone. I searched for it, I found many answers, I tried them but no one is working.
I need to unlock phone on onCreate() and lock phone again while I'm finishing my activity.
Do you guys know any method…

Sanjay Joshi
- 2,036
- 6
- 33
- 48
9
votes
3 answers
KeyguardManager - requestDismissKeyguard() method alternative for api 25 and below [Android]
I was recently trying to request user to dismiss key-guard manually from my app. My app invokes a activity screen when device is locked and the screen has the flags
FLAG_SHOW_WHEN_LOCKED
FLAG_TURN_SCREEN_ON
When I have to invoke another screen…

Shangeeth Sivan
- 2,150
- 1
- 20
- 20
9
votes
2 answers
Disable Home Button in Android ICS (4.0)
I am making a proprietary app for a company which will never release it to the Android Market (or Play Store I guess now) in Ice Cream Sandwich (Android 4.0).
I need to disable the Home so the users cannot maliciously uninstall software or delete…

adamacdo
- 426
- 1
- 6
- 14
8
votes
3 answers
How to Disable Keyguard and display an activity to the user when receiver of SCREEN_ON is triggered?
How can I disable the keyguard when a broadcast receiver is activated by screen_on, so that when it occurs the user sees an activity that I have started behind it? (The activity is running already...)
I have been trying the following code from a…

Ryan
- 161
- 1
- 1
- 8
8
votes
5 answers
Android - how to completely disable keyguard
I want to control enabling/disabling keyguard on the device.
To do that I'm using DevicePolicyManager and KeyguardLock API of Android SDK.
Below is my implementation to manage this:
public class DeviceLocker {
private static DeviceLocker…

kowalski
- 81
- 1
- 1
- 3
6
votes
0 answers
Full screen intent activity is not displayed on lookscreen when device is locked with pin/password
I want to show a short questionnaire on the Android look screen, as soon as the user locks their device. For this I detect a screen lock event and show an activity with a full screen intent notification.
val fullScreenIntent = Intent(context,…

Myria
- 61
- 5
5
votes
1 answer
How to start a activity from a broadcast receiver when the screen is locked in Android Q
I am trying to implement an alarm based application in Android Q using a broadcast receiver. I am running a foreground service using notification for triggering the alarm broadcast receiver. The service is working fine and it is also triggering the…

Ram Keerthy
- 227
- 4
- 16
5
votes
0 answers
How to show floating-icon over Screen Locked?
I follow the tutorial of AndroidHive to create an Android Floating Widget like Facebook Chat Head. The app runs successfully and shows the floating icon. The problem occurs while the screen locked, the floating-icon disappears when the screen goes…

Rabindra Acharya
- 1,868
- 2
- 18
- 32