开发者

Changing screen brightness in Android emulator

开发者 https://www.devze.com 2023-01-19 06:32 出处:网络
Can screen brightness changes be tested in the Android emulator?I\'ve tried various examples that all use the following code snippet:

Can screen brightness changes be tested in the Android emulator? I've tried various examples that all use the following code snippet:

WindowManager.LayoutP开发者_如何学Pythonarams lp = window.getAttributes();
lp.screenBrightness = (*some float percentage*);
window.setAttributes(lp);

But I don't see any change in brightness in the emulator. I've tested it in cupcake and 2.2.


Brightness changes do not get reflected in the emulator. To confirm, you can check the phone settings in the emulator (Settings > Display > Brightness) and changing the brightness from there. It will not change.

To see the effects of changing the brightness, you'll need an actual device running android.

0

精彩评论

暂无评论...
验证码 换一张
取 消