Android保持屏幕常亮

    // 保持Android设备屏幕灯长亮  
        public static void setScreenBright(Activity activity, boolean keepScreenOn) {  
            if (keepScreenOn) {  
                activity.getWindow().addFlags(  
                        WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);  
            }  
        }  

编程技巧