| The action bar layout with the spacer view highlighted. |
Explanation
When working with LinearLayout there's an option to use weights of free space rather than a set amount of space. When the layout measures its children it first sets the fixed sized children. For this layout that's everyone except the spacer view. Then it does another pass to measure the children that will fill dimensions based on their android:layout_weight parameter. Since there's only 1 view with this parameter, it fills up the remaining space.XML Layout
The code that makes this work is the ImageView with the comment on it. @id/SpacerView