I am working on a app in which I have to lock and unlock the screen programmatically. Kindly help ! I have no any idea how to develop this type of functionality which support each version of Android OS.
After you've tried to unlock your phone multiple times, you'll see "Forgot pattern." Tap Forgot pattern. Enter the Google Account username and password you previously added to your phone. Reset your screen lock. Learn how to set a screen lock.
Bypass Samsung Pattern Lock with ResettingIn Android Recovery Mode, you are able to bypass pattern lock by resetting your phone with physical buttons.
To Unlock
KeyguardManager km = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE); final KeyguardManager.KeyguardLock kl = km .newKeyguardLock("MyKeyguardLock"); kl.disableKeyguard(); PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); WakeLock wakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE, "MyWakeLock"); wakeLock.acquire();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With