Question

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+.

Était-ce utile?

La solution

WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = <value from 0 to 1>;
getWindow().setAttributes(lp);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top