is Screen On - Android Phone

Android examples for Phone:Screen

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 powerManager = (PowerManager) context
                .getSystemService(Context.POWER_SERVICE);
        return powerManager.isScreenOn();
    }/*w w  w  .j  a v a 2 s .c  o  m*/
}

Related Tutorials