1、系统亮度最大值的获取方法:
int brightnessSettingMaximumId = getResources().getIdentifier("config_screenBrightnessSettingMaximum", "integer", "android");
int brightnessSettingMaximum = getResources().getInteger(brightnessSettingMaximumId);
2、系统亮度最小值的获取方法:
int brightnessSettingMinimumId = getResources().getIdentifier("config_screenBrightnessSettingMinimum", "integer", "android");
int brightnessSettingMinimum = getResources().getInteger(brightnessSettingMinimumId);
不同手机上获取的系统亮度最大值与最小值不一定是一样的,这个值是写在系统资源文件里面的,资源id的名字分别是config_screenBrightnessSettingMaximum和config_screenBrightnessSettingMinimum。