I want to differentiate the groups by giving them a title or divider, but I can\'t find a title option for the group element.
Is there a way to add a title or divider?>
Although that might not be the best approach, I believe it might help you out. What about you add extra disabled itens as "titles" inside the groups, also you could create a style for those itens so they might show the color you want.
You also can try something like that, using java.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
menu.addSubMenu(Menu.NONE, 1, 1, "SubMenu");
menu.add(1, 2, 2, "Item");
menu.add(1, 3, 3, "Item");
menu.addSubMenu(Menu.NONE, Menu.NONE, 4, "SubMenu");
menu.add(4, 5, 5, "Item");
menu.add(4, 6, 6, "Item");
menu.add(4, 7, 7, "Item");
return true;
}
Parameters
Yet, I believe both should have the same result.
I hope it help you.