WindowManager.LayoutParams localLayoutParams = getWindow().getAttributes();
System.out.println(localLayoutParams.screenBrightness);
localLayoutParams.screenBrightness = new Random(System.currentTimeMillis()).nextInt(10)*1F/10F;
getWindow().setAttributes(localLayoutParams);
说的都没错,但是如果嵌套在tabtab里卖弄的话,请getParent().......