Is it possible to add a separator between menu items in Android’s context menu? I don’t see any directions for this in the documentation. Apparently menu items should be separated in some cases when they perform operations of a different kind.
NB. The question is about context menu, not options menu.
First I thought of only one workaround – a custom implementation of a context menu, such as Icon Context Menu for example. Such a code allows for extending menu item class to a specific menu separator class with custom view.
… But some time later I have found that …
Another (much easier) solution could be adding a menu item with a row of ‘_’ (underline) characters (surprisingly this is the only symbol in standard Android font which multiple instances can be shown smoothly side by side without gaps), and then aligning the item text in Java code using
SpannableString.String resource:
Adjust the string length as appropriate.
Menu layout:
Java: