Android – Positioning menu items to the left of the ActionBar in Honeycomb

androidandroid-3.0-honeycombandroid-actionbar

I want to position some menu items to the left of Honycomb's ActionBar, but have found no documentation showing how to do this. It looks like it should be possible since the Contacts app has search to the immediate left of the navigation bar. Any idea as to how to set menu items to the left side?

Best Answer

The ActionBar has support for a custom layout between the application icon and the regular ActionBar icons. Example:

// Set the custom section of the ActionBar with Browse and Search.
ActionBar actionBar = getActionBar();
mActionBarView = getLayoutInflater().inflate(R.layout.action_bar_custom, null);
actionBar.setCustomView(mActionBarView);
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);