Android Question Setting AppBar Color

EduardoElias

Well-Known Member
Licensed User
Longtime User
I set the color of my appbar to orange at first time and it works.

After that I have a timer that every 5 seconds check WIFI Signal LEVEL.

If the Level quality drops I change the App Bar color accordingly giving and clue to the user.

I am using this code

B4X:
Sub SetActionBarColor(Color As Int)
    Dim jo As JavaObject
    jo.InitializeContext
    Dim cd As ColorDrawable
    cd.Initialize(Color, 0)
    jo.RunMethodJO("getActionBar", Null).RunMethod("setBackgroundDrawable", Array(cd))
End Sub

On a Motorola Xoom 4.0.4 Android

What is happening is that the color is turning to black, that I am not using at all.

It happens when trying to set Orange as color, it turns as black.

In every other tablet and cellphone that I have it is work just as expected. Only this one cause this problem.

Using lastest B4A
 
Top