I have the following issue with my app, specifically with the Action Bar:
and the ID (indicated with the red rectangle) but since the size of the Action Bar nor the icons contained in cannot be changed due to esthetic reasons, I would like to display a text with the whole number and ID when the users press in the section I've highlighted.
Currently, I'm setting the text like this(delivery var and idDelivery are Strings):
ActionBar ab = getActionBar();
ab.setTitle(delivery);
ab.setSubtitle("ID:" + idDelivery);
Any ideas?
Change MenuItem
s showAsAction
attribute to ifRoom
:
<item app:showAsAction="ifRoom"
.../>
From docs:
Only place this item in the app bar if there is room for it. If there is not room for all the items marked "ifRoom", the items with the lowest orderInCategory values are displayed as actions, and the remaining items are displayed in the overflow menu.
Thus, the title of your Toolbar
would be given higher priority, and MenuItem
s would be displayed only when there is enough room for them, otherwise they would be left to be displayed under overflow icon popup menu.