【发布时间】:2011-04-13 20:21:01
【问题描述】:
我想在 android 中以编程方式更改屏幕亮度。 目前我使用此代码:
WindowManager.LayoutParams lp = getWindow().getAttributes();
float brightness=1.0f;
lp.screenBrightness = brightness;
getWindow().setAttributes(lp);
但此示例代码适用于纸杯蛋糕,而不适用于最新版本。我正在使用最新版本的 SDK。对于较新的 Android 版本,首选的解决方案是什么?
【问题讨论】:
-
增加对话框显示亮度stackoverflow.com/a/29091233/185022