android - Dynamic Menu item no show Icon -


i mount navigationview dynamically this:

@override protected void onpostcreate(bundle savedinstancestate) {         //nvdrawer mount         menu menu = nvdrawer.getmenu();         (mymenuitem kmi : menus.values()) {             menu.add(kmi.gettext());             menuitem mi = menu.getitem(menu.size() - 1);              mi.settitle(kmi.gettext());             drawable dicon =                     getresources().getdrawable(getresources()                             .getidentifier(s                             tring.valueof(kmi.geticonid()), "drawable", getpackagename()));             mi.seticon(dicon);         }   } 

so, debug , dicon setted, icon there appears in running app. every menus appears, none icon appears, silver rectangles.

p.s: icons png images.

i'm waiting.

dimmy, if you're running code on android 3.0+, icons in menu not shown design. design decision google.

you can read more below on android developers blog. hope helps. http://android-developers.blogspot.in/2012/01/say-goodbye-to-menu-button.html


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -