Make lock button switch off the screen without locking it
It would be great if switching on/off the screen could be realized by the lock button with no need to unlock the screen. Code:
KeyguardLock kgLock;
public void onCreate() {
KeyguardManager kgm = (KeyguardManager) getSystemService(Activity.KEYGUARD_SERVICE);
kgLock = kgm.newKeyguardLock(TAG);
kgLock.disableKeyguard();
}
@Override
protected void onDestroy() {
kgLock.reenableKeyguard();
super.onDestroy();
}
@Override
protected void onPause() {
super.onPause();
kgLock.reenableKeyguard();
}
@Override
protected void onResume() {
super.onResume();
kgLock.disableKeyguard();
}
6
votes
bizarre
shared this idea
-
blackeyex2 commented
Google maps navigation can do this, I would be nice if Waze could as well!