I want to change the menu item background beacuse I use black icons, but on some phones the default color of background is black or other dark color. I tried this solution a
The style attribute for the menu background is android:panelFullBackground
. It's not hackish like the other solution, so it's not as buggy.
Despite what the documentation says, it needs to be a resource (e.g. @android:color/black
or @drawable/my_drawable
), it will crash if you use a color value directly.
try to use android own menu icon like as setIcon(android.R.drawable.ic_menu_search)