I am making a menu for an app and was pointed to this useful resource which lists all the drawables that are part of the android 2.0 jar. the usage example given is
myMenuItem.setIcon(android.R.drawable.ic_menu_save);
Unfortunately, the one I want (and most of the list) are not available by default. I get
android.R.drawable.ic_menu_login cannot be resolved
when I try to set the menu item images:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Add two example menu buttons
int groupId = 0;
int menuItemOrder = Menu.NONE;
int menuItemId = 1;
String menuItemText = "Add Login Details";
MenuItem menuItem = menu.add(groupId, menuItemId, menuItemOrder, menuItemText);
menuItem.setIcon(android.R.drawable.ic_menu_login )
Did something change in recent android releases? It seems that most of these are now 'private resources'... couldn't find much info on this but I found some advice:
It is used to access private resources. Do not use it because these private resources are often removed/renamed/etc. Using it would most likely break your app in the future.
Why would they change the resource names anyway?(the images behind them sure, but the names?) How do I access ic_menu_login then? Is there a better reason not to than the above?