문제

How I can change screen brightness in Android?

I can find how to do this for application, but I want do it for all system and permanently (until user changes it in options).

I don't need to set it for custom value. Just low brightness level, Medium brightness and Maximum will be perfect.

It is possible for example with PowerManager or something like that \?

Using Android 2.0+.

도움이 되었습니까?

해결책

WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = <value from 0 to 1>;
getWindow().setAttributes(lp);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top