Search code examples
androidcontextmenuword-wrap

ContextMenu text overflowing


I am trying to place a ContextMenu on my ListActivity when the user clicks on any list item, which displays several sub-categories. Don't bother telling me other alternatives (ExpandableList, RadioButton, etc).

How can I get the FULL text to show up, instead of it being truncated? Here is how I am populating the ContextMenu:

    @Override  
    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {  
        super.onCreateContextMenu(menu, v, menuInfo);  

        //Fill context menu with appropriate subcategory
        menu.setHeaderTitle("Categories");
        for(String item : menuItem)
        {
            menu.add(0, v.getId(), menu.size()+1, item);
        }
    }

Note that menuItem is simply a String[ ] array

Here is my ContextMenu. ContextMenu I feel like a moron having not enough reputation to post pictures.


Solution

  • The only way I know of would be to create your menu from XML rather than just in code and change the text size so all your text will fit. I looked around for a bit and could find no information on any way to change the text size of the program generated menu.

    Docs regarding creating a context menu from XML are here.