Well, OK. Select the Reflection library. The sub bellow will set a variable - 'DeviceLocked' to either 0 or 1:
Sub CheckLock
Dim r As Reflector
Dim isLock As Boolean
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "keyguard", "java.lang.String")
isLock = r.RunMethod("inKeyguardRestrictedInputMode")
If isLock = False Then
DeviceLocked = 0
Else
DeviceLocked = 1
End If
End Sub
Don't take this the wrong way, I am just trying to teach you how to program faster/easier
B4X:
Sub CheckLock as boolean
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "keyguard", "java.lang.String")
return r.RunMethod("inKeyguardRestrictedInputMode")
end sub
Don't take this the wrong way, I am just trying to teach you how to program faster/easier
B4X:
Sub CheckLock as boolean
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "keyguard", "java.lang.String")
return r.RunMethod("inKeyguardRestrictedInputMode")
end sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.