michael michael - 5 months ago 13
Android Question

How can I create an android menu item using android setting icon

Can you please tell me how can I create an android menu item using android setting icon?

Answer

Here is a list of the standard icons. I don't see a "settings" icon. Perhaps you mean "Preferences" (ic_menu_preferences)?

You can set the icon programmatically like this:

menu.add(0, MENU_QUIT, 0, "Quit").setIcon(R.drawable.menu_quit_icon);

You can also set it in your xml layout like this:

<item android:id="@+id/save_button"
      android:icon="@android:drawable/ic_menu_save"
      android:title="Save Image"/>
Comments