简体   繁体   English

在Android模拟器中更改屏幕亮度

[英]Changing screen brightness in Android emulator

Can screen brightness changes be tested in the Android emulator? 可以在Android模拟器中测试屏幕亮度变化吗? I've tried various examples that all use the following code snippet: 我尝试了各种使用以下代码片段的示例:

WindowManager.LayoutParams 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. 我用蛋糕和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. 要查看更改亮度的效果,您需要一个运行android的实际设备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM