Friday 4 February 2011

Get system screen brightness

Last exercise describe how to "Change system screen brightness". If you want to get the current setting of system screen brightness, you can use the code:

        try {
curBrightnessValue=android.provider.Settings.System.getInt(
getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS);
} catch (SettingNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

No comments:

Post a Comment