Specify the Actions in XML
All action buttons and other items available in the action overflow are defined in an XML menu resource. To add actions to the action bar, create a new XML file in your project's res/menu/
directory.
Add an
element for each item you want to include in the action bar. For example:
res/menu/
directory.
element for each item you want to include in the action bar. For example:Download action bar icons
To best match the Android iconographyguidelines, you should use icons provided in the Action Bar Icon Pack.
This declares that the Search action should appear as an action button when room is available in the action bar, but the Settings action should always appear in the overflow. (By default, all actions appear in the overflow, but it's good practice to explicitly declare your design intentions for each action.)
To best match the Android iconographyguidelines, you should use icons provided in the Action Bar Icon Pack.