is Screen On via PowerManager - Android android.app

Android examples for android.app:Screen

Description

is Screen On via PowerManager

Demo Code

import android.content.Context;
import android.os.PowerManager;

public class Main{

    public static boolean isScreenOn(Context context) {
        return ((PowerManager) context
                .getSystemService(Context.POWER_SERVICE)).isScreenOn();
    }/*from  ww w  . j  a v  a  2s.  c o m*/

}

Related Tutorials