iOS Question How can I restore brightness when App goes to Background

cooperlegend

Active Member
Licensed User
Longtime User
B4X:
Private Sub Application_Background
    Log("Moving to BackGround")
    Common.RestoreBrightness
    App.IdleTimerDisabled = False
    Common.InactivityTimer.Enabled = False
    Sleep(10)
    Log("Move Complete")
End Sub

B4X:
Public Sub RestoreBrightness

    Dim no As NativeObject
    no.Initialize("UIScreen").RunMethod("mainScreen", Null).SetField("brightness", brightness)

End Sub

Using the above code when the screen is dimmed is not restore the original brightness (0.1 to 1.0) when the Home button is pressed.

Any ideas?
 

cooperlegend

Active Member
Licensed User
Longtime User
Sleep was put in as a last resort.

RestoreBrightness sub works fine everywhere else, but not in Application_Background, why is this?
 
Upvote 0
Top