get Keyguard Lock Screen Is Showing - Android User Interface

Android examples for User Interface:Screen Lock

Description

get Keyguard Lock Screen Is Showing

Demo Code


//package com.java2s;

import android.app.KeyguardManager;
import android.content.Context;

public class Main {
    public static boolean getKeyguardLockScreenIsShowing(Context context) {
        KeyguardManager keyguardManager = (KeyguardManager) context
                .getSystemService(Context.KEYGUARD_SERVICE);
        return keyguardManager.inKeyguardRestrictedInputMode();
    }//w  w w. j  a  v a  2 s .co  m
}

Related Tutorials