//启用屏幕常亮功能 PowerManager pm =(PowerManager) getSystemService(POWER_SERVICE); wakeLock= pm.newWakeLock(PowerManager.FULL_WAKE_LOCK| PowerManager.ACQUIRE_CAUSES_WAKEUP, myPowerManager.TAG); wakeLock.acquire(); //关闭 屏幕常亮功能 if (wakeLock != null) {wakeLock.release();}
< uses-permission android:name ="android.permission.WAKE_LOCK" /> < uses-permission android:name ="android.permission.DEVICE_POWER" />
FULL_WAKE_LOCK :保持CPU 运转,保持屏幕高亮显示,键盘灯也保持亮度.
转载请注明出处:周木水的CSDN博客 http://blog.csdn.net/zhoumushui
我的GitHub:周木水的GitHub https://github.com/zhoumushui
原文地址:http://blog.csdn.net/zhoumushui/article/details/40544365