java - Icon is not set on submenu -


i had made sub menu in android , wanted add icon on sub-menu not display. have written following snippet of code:

    int base = menu.first;      submenu sm = menu.addsubmenu(base, base + 1, menu.none, "submenu");     menuitem item1 = sm.add(base, base + 2, base + 2, "sub item1");      sm.add(base, base + 3, base + 3, "sub item2").seticon(r.drawable.block_user);     sm.add(base, base + 4, base + 4, "sub item3").seticon(r.drawable.extendedaway);     item1.seticon(r.drawable.away);     sm.seticon(r.drawable.chaty);  

i don't think icons supported submenus. have search here in so, here example: adding icon submenu items

see tutorial: http://www.linuxtopia.org/online_books/android/devguide/guide/topics/ui/menus.html

options menu

this primary set of menu items activity. revealed pressing device menu key. within options menu 2 groups of menu items:

icon menu collection of items visible @ bottom of screen @ press of menu key. supports maximum of 6 menu items. these menu items support icons , menu items not support checkboxes or radio buttons.

expanded menu vertical list of items exposed "more" menu item icon menu. exists when icon menu becomes over-loaded , comprised of sixth option menu item , rest.

it's bit dated don't think has changed.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -