I think that if you put menu items in one group it will try to keep them together. To control order of menu items is better when you create Menu in your activity, not using XML. In your activity you can get menu items in group something like this:
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
int group1Id = 1;
int Id1 = Menu.FIRST;
int Id2 = Menu.FIRST +1;
int Id3 = Menu.FIRST +2;
super.onCreateOptionsMenu(menu);
menu.add(group1Id, Id1, 1, "Option 1");
menu.add(group1Id, Id2, 2, "Option 2");
menu.add(group1Id, Id3, 3, "Option 3");
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
super.onOptionsItemSelected(item);
switch (item.getItemId()) {
case 1: //for option 1
return true;
case 2: //for option 2
return true;
case 3: //for option 3
return true;
default:
return false;
}
Parameters:
groupId The group identifier that this item should be part of.
itemId Unique item ID. Use NONE if you do not need a unique ID.
order The order for the item. Use NONE if you do not care about the order.
title The text to display for the item.
Returns:
The newly added menu item.