shayan pourvatan shayan pourvatan - 1 year ago 101
Android Question

icon in menu not showing in android

i want to add menu handler to my project, i read too,its very simple but icon not shown to me, i very confused. even i add menu item programmatically.
my code is:

public boolean onCreateOptionsMenu(Menu menu) {
menu.add(0, 0, 0, "Quit").setIcon(R.drawable.ic_launcher);
getMenuInflater().inflate(, menu);
return true;

and in xml:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="">
<!-- Single menu item
Set id, icon and Title for each menu item
<item android:id="@+id/menu_bookmark"
android:title="@string/Update" />


Answer Source

If you're running your code on Android 3.0+, the icons in the menu are not shown by design. This is a design decision by Google.

You can read more about it in this on Android developers blog.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download