I'm developing an app that uses ActionBarSherlock.
As you know, using android:showAsAction
attribute, you can display an action menu on action bar. And, the number of menu items displayed on action bar differs according to user's environment(resolution, portrait/landscape and so on).
So, is it possible to get it by code?
No, you can't.
It varies based on a few factors and it would be safe if you just assume that it varies and can be anywhere from two to five (including a potential overflow menu item).