Android:如何以编程方式打开和关闭屏幕?
关闭显示测试
params.flags |= LayoutParams.FLAG_KEEP_SCREEN_ON;params.screenBrightness = 0;getWindow().setAttributes(params);
打开显示测试
params.flags |= LayoutParams.FLAG_KEEP_SCREEN_ON;params.screenBrightness = -1f;getWindow().setAttributes(params);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "tag");wl.acquire();
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
params.screenBrightness = -1
红糖糍粑
摇曳的蔷薇
相关分类