telephone is sleeping - Android Network

Android examples for Network:Ping

Description

telephone is sleeping

Demo Code


//package com.java2s;

import android.app.KeyguardManager;

import android.content.Context;

public class Main {
    /**/* ww  w . ja  v a 2s .  c  o m*/
     * telephone is sleeping
     *
     * @param context
     * @return
     */
    public static boolean isSleeping(Context context) {
        KeyguardManager keyguardManager = (KeyguardManager) context
                .getSystemService(Context.KEYGUARD_SERVICE);
        return keyguardManager.inKeyguardRestrictedInputMode();
    }
}

Related Tutorials