Set Item postition in ActionBar

Viewed 11876

I have this layout that add 1 or more items into the ActionBar

<?xml version="1.0" encoding="utf-8"?> 
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
        <item
           android:id="@+id/item_test"                
           android:showAsAction="always|withText"
           android:title="SearchIcon"/> 
</menu>

And then I will add another item dynamically into the ActionBar from another Fragment or Activity

MenuItem populateItem = menu.add("My New Item - Reload Icon");

But I want the item that I just added to stay in front of the items I had before, like the picture:

enter image description here

If I add it like I did, the icons will be shown as the last picture, how can I get the alignment like in the second picture?

1 Answers
Related