check whether lock was enabled or not

后端 未结 9 1333
情书的邮戳
情书的邮戳 2020-11-30 23:52

I have to check whether system lock was enabled or not in settings.

I used below line code

boolean b = android.provider.Settings.System.getInt(
              


        
9条回答
  •  -上瘾入骨i
    2020-12-01 00:17

    @Peter Pint

    int lockProtectionLevel = (int)method.invoke(lockUtils);
    

    ...should instead be...

    int lockProtectionLevel = Integer.valueOf(String.valueOf(method.invoke(lockUtils)));
    

    But otherwise, right on! I've upvoted your answer.

提交回复
热议问题