Hi all,
I use CoronaEnterprise Sample project to control the global brightess setting in Android device.
After I updated the screen brightness, the screen brightess of Corona Activity does not change.
Does anyone know how to update / refresh the screen brightness of Corona Activity ?
Aim: Control the global brightness setting of android device through Corona UI.
Update Brightness setting in android
[lua]
android.provider.Settings.System.putInt(contentResolver,
android.provider.Settings.System.SCREEN_BRIGHTNESS,
brightness);
[/lua]
After updated the brightness, it should refresh the screen.
[lua]
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = (float)brightness / 255;
getWindow().setAttributes(lp);]
[/lua]
Thanks.
Sam