到目前为止,我在搜索中看到了两种方法,这两种方法都遇到了麻烦.
方法1)
Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, 100);
Run Code Online (Sandbox Code Playgroud)
方法2)
IHardwareService hardware = IHardwareService.Stub.asInterface(ServiceManager.getService("hardware"));
hardware.setScreenBacklight(.5);
Run Code Online (Sandbox Code Playgroud)
以下哪种方法是正确的?还是我应该使用另一个?
谢谢
android ×2