views:

42

answers:

1

I was trying to set up my options menu so that there would be 2 buttons on the 1st and 2nd row and then 1 button on the 3rd row. Here is the code I was trying to use but I'm guessing groupID argument isn't what I thought it was.

  menu.add(1, MENU_NAME, 1, "by Name");
  menu.add(1, MENU_NUMBER, 2, "by Number");
  menu.add(2, MENU_POSITION, 1, "by Position");
  menu.add(2, MENU_COLLEGE, 2, "by College");
  menu.add(3, MENU_UPDATE, 1, "Update Roster");

Maybe this is solved somehow with the XML Layout but I'm not really good with the layouts ;( So I managed to not get too far that way either.

+1  A: 

I don't believe that is possible. A max of 6 items from a menu can be visible at one time, and they will always show up in a max of 2 rows. Menu groups are just a way of being able to refer to menu items collectively in code, they do not have any visual effect. See menu groups.

Mayra
Is it possible then to have the first four display on the first row and the last one on the second row by itself? Thanks for your explanation of the menu groups!
fwaokda
As far as I'm aware, you have no control over the placement of menu items beyond their order, and if you place anything in sub menus.
Mayra
Bummer, well thanks for all the good info really helpful!
fwaokda