Turn off automatic brightness?

rfresh

Well-Known Member
Licensed User
Longtime User
I'm using the code below to change the screen brightness. But I need to make sure the automatic brightness is not enabled. How can I program the Display "automatic brightness" to off or disabled?

Thanks...

B4X:
p.SetScreenBrightness(pIntensity/255)
WriteSetting("screen_brightness", pIntensity)

B4X:
Sub WriteSetting(Setting As String, Value As Int)
    Dim r1 As Reflector
    Dim args(3) As Object
    Dim types(3) As String
    r1.Target = r1.GetContext
    args(0) = r1.RunMethod("getContentResolver")
    types(0) = "android.content.ContentResolver"
    args(1) = Setting
    types(1) = "java.lang.String"
    args(2) = Value
    types(2) = "java.lang.int"
    r1.RunStaticMethod("android.provider.Settings$System", "putInt", args, types) 
End Sub
 
Top