Reference:
https://stackoverflow.com/questions/8317331/detecting-when-screen-is-lockedCode snippet:
KeyguardManager keyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE); boolean isPhoneLocked = keyguardManager.inKeyguardRestrictedInputMode();
沒有留言:
張貼留言