Jort Jort - 1 year ago 82
Android Question

Android options menu icon won't display

I'm following a book on Android Development to get myself started writing my first real app.
I got up to the point where I'm making an options menu for one of my activities. The menu shows up, but the corresponding icon of the menu item refuses to display.
Here is the code for the menu:


public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater mi = getMenuInflater();
mi.inflate(, menu);
return true;


<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="" >
<item android:id="@+id/menu_insert"
android:title="@string/menu_insert" />


I have copied the ic_menu_add.png icon (32x32px) from one of my Android SDK subfolders to my res/drawable-mdpi folder and renamed the file to menu_add.png. I refreshed the folder within eclipse so the icon shows up, and as you can see I set it as the icon for the menu item in my layout file. I tried running my project in the emulator a few times, but the icon never shows up. For the record, I am using Android 4.0.3..

Any ideas?

Answer Source

On Android 3.0+, the preferred approach for the options menu (a spillover menu in the action bar) will not show icons. If you have android:targetSdkVersion="11" or higher, icons will never show up in menus on Android 3.0+. The icons will show up if you promote an options menu item to be a toolbar button, and the icons will show up on Android 1.x/2.x devices.