我想在android中以编程方式更改屏幕亮度。 目前我使用此代码:在android中以编程方式更改屏幕亮度
WindowManager.LayoutParams lp = getWindow().getAttributes();
float brightness=1.0f;
lp.screenBrightness = brightness;
getWindow().setAttributes(lp);
但此示例代码适用于蛋糕,而不是最新版本。我正在使用最新版本的SDK ..对于更新的Android版本,首选解决方案是什么?
可能重复(http://stackoverflow.com/questions/5032588/cant-apply-system-screen-brightness-programmatically-in-android) – bummi 2014-09-22 13:23:23
增加对话框显示的亮度http://stackoverflow.com/a/29091233/185022 – 2015-03-17 04:23:04