AndroidManifest.xml加两个权限 <uses-permission android:name="android.permission.DISABLE_KEYGUARD"></uses-permission> <uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>
?
?
?
public static boolean isWallPaperLocked(Context context) { KeyguardManager keyguardManager = (KeyguardManager) context .getSystemService(context.KEYGUARD_SERVICE); return keyguardManager.inKeyguardRestrictedInputMode(); }
?