Question: Is there a way to check in code if a MenuItem (or which MenuItems) are in the overflow menu of the ActionBar?
I’m using ActionBarSherlock
The reason I need this is because I have a bunch of icons that will show up in the ActionBar if there is room. I have a holo dark theme so the icons are made to fit that.
My problem comes when the menu items are put into the overflow menu. On Pre-Honeycomb devices this means they will show when the user presses the menu button. This menu is the exact opposite background as my ActionBar and I want to have a different set of icons to fit that.
I might have found a solution to this problem: In the Design Guide (here), there is a table that shows how many action bar items are shown depending on the width in dip.
Based on that table I have written the following code: