Android Question Action bar menu color?

kostefar

Active Member
Licensed User
Longtime User
Dear All,

I have this theme in my manifest:

B4X:
SetApplicationAttribute(android:theme, "@android:style/Theme.Material")

To change the background color (to blue) and remove the icon, I used:

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))
   
    jo.RunMethodJO("getActionBar", Null).Runmethod("setIcon",Array(cd))
   
End Sub

But the menu made with addmenuitem popping up is all dark - prolly because of the theme color I want it to be white. Is there an easy way to change it, as done with the actionbar background?

It looks like this:



Thanks in advance!
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…