Minox 7 Posted May 10, 2023 Hi all, I have a code to maximize and minimize screen brightness for android app, which works fine in 32bit, but not in 64bit. Here is the code: USES Androidapi.JNI.GraphicsContentViewText, Androidapi.Helpers; procedure TForm1.Button1Click(Sender: TObject); //min VAR appParam : JWindowManager_LayoutParams; begin appParam := TAndroidHelper.Activity.getWindow.getAttributes; appParam.screenBrightness := TJWindowManager_LayoutParams.JavaClass.BRIGHTNESS_OVERRIDE_OFF; TAndroidHelper.Activity.getWindow.setAttributes(appParam); end; procedure TForm1.Button2Click(Sender: TObject); //max VAR appParam : JWindowManager_LayoutParams; begin appParam := TAndroidHelper.Activity.getWindow.getAttributes; appParam.screenBrightness := TJWindowManager_LayoutParams.JavaClass.BRIGHTNESS_OVERRIDE_FULL; TAndroidHelper.Activity.getWindow.setAttributes(appParam); end; procedure TForm1.Button3Click(Sender: TObject); //norm VAR appParam : JWindowManager_LayoutParams; begin appParam := TAndroidHelper.Activity.getWindow.getAttributes; appParam.screenBrightness := TJWindowManager_LayoutParams.JavaClass.BRIGHTNESS_OVERRIDE_NONE; TAndroidHelper.Activity.getWindow.setAttributes(appParam); end; I don't understand why it doesn't work, do I have to ask permission for the 64bit app and manually change the brightness? Share this post Link to post