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
1
vote
1 answer
Keyguard manager how to remove cancel button
When using KeyguardManager, how do I remove the cancel button? There is a cancel button that appears on left side.
if(km.isKeyguardSecure()) {
Intent i = km.createConfirmDeviceCredentialIntent("Authentication required", "password");
…

saneesh
- 137
- 11
1
vote
2 answers
Disable lock Screen in Android 21 and above
I am trying to disable lock screen while making my screen turn off but as soon as screen turns off lock is held again.
I am using below code to disable the lock screen:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
…

Prakhar Gupta
- 131
- 7
1
vote
1 answer
Activity does not start until the screen is turned on
My service starts an Activity like this:
Intent intent = new Intent(context,…

almisoft
- 2,153
- 2
- 25
- 33
1
vote
0 answers
Requesting the user password
I have an app, that features a screen which should be protected by for example KeyguardManager.createConfirmDeviceCredentialIntent. This api however, is only available on 21+, I've tried using the KeyguardManager.newKeyguardLock and setting…

user_4685247
- 2,878
- 2
- 17
- 43
1
vote
0 answers
How to Unlock Android Screen From inside Service (Marshmallow)?
I am developing an app to schedule whattsapp messages. Curruntly i want to unlock screen and start whattsapp intent and send msg inside my service . I searched here and tried following solution. but both are depreciated. Method 1 (depreciated) …

Hemant patel
- 21
- 4
1
vote
0 answers
For api < 16: How to detect if PIN/password/pattern is required to unlock phone?
I already know these two cases:
1) for devices using api >= 16, one could just use the method isDeviceSecure() from KeyguardManager and that would return true if any locking mechanism is used on the device (pattern, passcode, password, etc.)
2) for…

rafcolm_
- 159
- 1
- 8
1
vote
0 answers
Programmatically show pattern screen lock
I wrote an android app (with system privileges and Admin permission is granted).
In my application, at first time in the device, I am setting programmatically a new pattern screen lock, then running some things and then I want to close my app and to…

FarFarAwayUser
- 133
- 12
1
vote
0 answers
Unable to unlock pattern in Android Marshmallow on notification arrival
I am trying to unlock screen as soon as notification arrives . I have applied this code (tried 2 code snippet) but none of them is working for android marshmallow and working fine for lollipop .
Code snippet 1:
KeyguardManager km = (KeyguardManager)…

Kalpit
- 47
- 7
1
vote
0 answers
Any callback or broadcast for keyguard unlock using Smart Lock(Face)?
Smart lock set using trusted face on device.
after that, when I turn on screen it is secure lock til face recognition finished.
I checked using KeguardManger.isDeviceLocked.
it return true when turn on device, and return false after recognition…

Miguel Park
- 11
- 1
1
vote
1 answer
set device screen lock unlock using reflection
I am using reflection to unlock my device screen setting keyguard as disabled.my android version is 4.4.2.while invoking i get exception as java.lang.reflect.InvocationTargetException and cause as java.lang.SecurityException: LockSettingsWrite:…

tanmeet
- 220
- 2
- 11
1
vote
1 answer
disableKeyguard call on application freezes phone
On an Android 6.0 project, I am trying to unlock the phone using the proximity sensor.
This what I have for OnSensorChanged event:
public void onSensorChanged(SensorEvent event) {
proxValue = (event.values[0]); //sensor value stored…

Kaan Demirel
- 180
- 1
- 2
- 16
1
vote
0 answers
Check whether Android screen is locked or not
I need to do something whenever an Android device (running Android 4.0 onwards) is locked or unlocked. The requisites are as follow:
If screen lock is set to "None", I do not consider the device to be locked when the power button is pressed and the…

user2891462
- 3,033
- 2
- 32
- 60
1
vote
0 answers
Dialog disappears even if the flag FLAG_SHOW_WHEN_LOCKED is set, when the screen is locked
I work on an app and I face a strange issue. When the screen is locked, I have a dialog that appears when the app gets activated and it is working fine for Lolipop, KitKat and older versions. The problem seems to appear only in V6 Marshmallow: the…

GGechetlaios
- 21
- 3
1
vote
0 answers
Accepting Android volume rocker input across a range of states
I have an app that will generally be the sole app for which a device (Android 4.2 and up) is used. It needs to be able to accept input from the volume rockers in the following scenarios:
app is in foreground
app is in background
lock screen or…

William
- 20,150
- 8
- 49
- 91
1
vote
1 answer
Can't get app to unlock keyboard programatically [None of existing solutions work!]
I have read through about 10-15 posts on Stackoverflow and all of them seem to have answers that resolved the questioner's issues but I can't seem to get those solutions to work for my case.
I have an app which allows for setting an alarm and the…

LeoNeo
- 739
- 1
- 9
- 28