I am using the following. Put this method in your activity and call it in the onCreateOptionsMenu method (menu). Instead of setting backgroundResource, you can just set the color ... just enter view.setbackground and view the options through autocomplete;)
protected void setMenuBackground() { Log.d(TAG, "Enterting setMenuBackGround"); getLayoutInflater().setFactory(new Factory() { public View onCreateView(String name, Context context, AttributeSet attrs) { if (name .equalsIgnoreCase("com.android.internal.view.menu.IconMenuItemView")) { try {
.
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); getMenuInflater().inflate(R.menu.start_menue, menu); setMenuBackground(); return true; }
Beasly Jan 04 2018-11-11T00: 00Z
source share