hi
I am developing an android application using Honeycomb android 3.0 . I am tryig to display a menu in Action Bar . The menu has an icon and tiltle. When we click the
Though the original question is a bit old and moreover, because reasoning against showing icons in the menu is somewhat lacking substance (see Steven Elliott's excellent remark Displaying icon for menu items of Action Bar in Honeycomb android 3.0), I'd like to point to a great, working solution that was given here:
@Override
public boolean onMenuOpened(int featureId, Menu menu) {
if(featureId == Window.FEATURE_ACTION_BAR && menu != null) {
if(menu.getClass().getSimpleName().equals("MenuBuilder")) {
try {
Method m = menu.getClass().getDeclaredMethod("setOptionalIconsVisible", Boolean.TYPE);
m.setAccessible(true);
m.invoke(menu, true);
} catch(NoSuchMethodException e) { //...
} catch(Exception e) { // ...
}
}
}
return super.onMenuOpened(featureId, menu);
}
Simply add this code to your activity and import the appropriate modules. Again, not my work, but working none the less.