disable keyGuard in Android 6.0
Asked Answered
F

0

8

I'm pretty new to Android programming. I want to write an intent that keeps my phone unlocked while connected to my home wifi. I've researched quite alot and kept finding the same answers.

This is what I've tried so far.

KeyguardManager mKeyGuardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE); 
KeyguardManager.KeyguardLock keyguard = mKeyGuardManager.newKeyguardLock("LockOut"); 
keyguard.disableKeyguard();

The problem is that this doesn't work with android 6.0, I've tested it with my old phone running on Lollipop and it works fine there. Does anyone know a workaround? Does it have something to do with the changement in the deviceManager class after API 23?

Flavopurpurin answered 4/2, 2016 at 11:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.