如何在Android中检测键盘保护状态 [英] How to detect key-guard state in android
本文介绍了如何在Android中检测键盘保护状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个应用程序,需要在调用由用户设置的disableKeyguard()
或reenableKeyguard()
之前检测键盘锁的先前状态!有什么办法可以完成这项任务?
I have an application that requires to detect the previous state of the key-guard before calling disableKeyguard()
or reenableKeyguard()
, set by the user! is there any way of accomplishing this task?
推荐答案
来自文档
使用
((KeyguardManager)getSystemService(Context.KEYGUARD_SERVICE)).isKeyguardLocked()
这篇关于如何在Android中检测键盘保护状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文