Java tutorial
//package com.java2s; import android.content.Context; import android.os.PowerManager; public class Main { public static boolean isDisplayOn(Context context) { PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); return powerManager.isScreenOn(); } }