Update Display Brightness on Android after changing it programmatically

前端 未结 3 1466
旧巷少年郎
旧巷少年郎 2020-12-15 11:02

I\'m trying to update the display brightness from a widget but i have some problems.

To change brightness level, i use:

Settings.System.putInt(contex         


        
3条回答
  •  Happy的楠姐
    2020-12-15 11:33

    First, the value to modify in LayoutParams is screenBrightness. You'll then have to do a window.setAttributes to apply it. As GeekYouUp said, you can make a dummy activity to get your Window object.

提交回复
热议问题