سؤال

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