Android how to check screen off 判断银幕是开还是关
Android how to check screen off 判断屏幕是开还是关。
如果你要监听屏幕开关的事件的话, 你需要监听这个两个ACTION_SCREEN_OFF and ACTION_SCREEN_ON intent broadcast
ref:http://stackoverflow.com/questions/7529733/how-to-discover-if-the-screen-is-on-or-off-while-developping-in-android
pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE); boolean screen = pm.isScreenOn();
如果你要监听屏幕开关的事件的话, 你需要监听这个两个ACTION_SCREEN_OFF and ACTION_SCREEN_ON intent broadcast
ref:http://stackoverflow.com/questions/7529733/how-to-discover-if-the-screen-is-on-or-off-while-developping-in-android