Android examples for User Interface:Screen Dormant
is Screen On from PowerManager
//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); boolean screen = pm.isScreenOn(); return screen; }/*from w w w. j a v a 2 s . c o m*/ }