在Android模拟器改变屏幕亮度 [英] Changing screen brightness in Android emulator
问题描述
能否屏幕亮度变化而在Android模拟器测试?我已经试过所有使用以下code段的各种例子:
Can screen brightness changes be tested in the Android emulator? 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);
但我没有看到在模拟器中亮度的任何变化。我在蛋糕和2.2进行了测试。
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.
要看到改变亮度的效果,你需要一个实际的设备运行Android。
To see the effects of changing the brightness, you'll need an actual device running android.
这篇关于在Android模拟器改变屏幕亮度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!