Skip to content

Instantly share code, notes, and snippets.

View adilthree's full-sized avatar

Adil khan adilthree

View GitHub Profile
@Jeevuz
Jeevuz / isDeviceLocked.java
Created September 20, 2016 10:41
Check device is currently locked
/**
* Returns true if the device is locked or screen turned off (in case password not set)
*/
public static boolean isDeviceLocked(Context context) {
boolean isLocked = false;
// First we check the locked state
KeyguardManager keyguardManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
boolean inKeyguardRestrictedInputMode = keyguardManager.inKeyguardRestrictedInputMode();
@daichan4649
daichan4649 / AndroidManifest.xml
Last active June 2, 2023 14:51
show Fragment on LockScreen (for Android)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="daichan4649.lockoverlay"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="17" />