Android Question [SOLVED] Change StatusBar icon color

Emme Developer

Well-Known Member
Licensed User
Longtime User
Is possible to change programmatically the color of icons in status bar?
I know it's possible to change it from theme, but i need to change it at Runtime.
I this way i change the color of status bar:

B4X:
Sub SetStatusBarColor(clr As Int)
    Dim p As Phone
    If p.SdkVersion > 20 Then
        Dim jo As JavaObject
        jo.InitializeContext
        Dim window As JavaObject = jo.RunMethodJO("getWindow", Null)
        window.RunMethod("addFlags", Array (0x80000000))
        window.RunMethod("clearFlags", Array (0x04000000))
        window.RunMethod("setStatusBarColor", Array(clr))
    End If
End Sub

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Emme Developer

Well-Known Member
Licensed User
Longtime User
Last edited:
Upvote 0
Top