I'm having trouble making an ActionBar's menu item look disabled.
This works well for pre-Honeycomb (popup) menus correctly, but doesn't
work on new menus.
I'm making items appearing on ActionBar itself (which looks like a
toolbar); disabled items cannot be pressed, yes, but they are not
grayed out as on older popup menus.
@Override
public boolean onPrepareOptionsMenu(Menu menu)
{
menu.clear();
for (ToolbarButton b : _current.getButtons())
{
MenuItem mi = menu.add(b.title);
mi.setEnabled(b.enabled); // <-- this doesn't change image
color
mi.setIcon(b.image.mutate());
mi.setOnMenuItemClickListener(b);
if (android.os.Build.VERSION.SDK_INT > 10)
mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
}
}
Any way to make it working? Or Honeycomb UI supposes that such items
should merely disappear?
TIA.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en