is Screen On - Android User Interface

Android examples for User Interface:Screen Lock

Description

is Screen On

Demo Code


//package com.java2s;

import android.content.Context;

import android.os.PowerManager;

public class Main {
    public static boolean isScreenOn(Context context) {
        PowerManager pm = (PowerManager) context
                .getSystemService(Context.POWER_SERVICE);
        return pm.isScreenOn();
    }//from   ww  w.  ja  v a 2  s . co m
}

Related Tutorials