如何在Android中检查手机是否被锁定?
答案 0 :(得分:0)
我附上了找到手机是否锁定的答案, 我宣布了下面的代码,
KeyguardManager km = (KeyguardManager)getSystemService(Context.KEYGUARD_SERVICE);
boolean locked = km.inKeyguardRestrictedInputMode();
if(locked == true){
// do something
}else{
// do something else
}