Add custom icon for bloat menu


Silicon 8

I'm trying to add an icon to a menu (because it looks boring)

enter image description here

my menu xml:

<menu xmlns:android="http://schemas.android.com/apk/res/android" >
    <item
        android:id="@+id/action_about"
        android:orderInCategory="200"
        android:showAsAction="never"
        android:icon="@drawable/icon"
        android:title="About" />
    <item
        android:id="@+id/action_help"
        android:orderInCategory="200"
        android:showAsAction="never"
        android:icon="@drawable/help"
        android:title="Help" />
    <item
        android:id="@+id/action_rate"
        android:orderInCategory="300"
        android:showAsAction="never"
        android:title="Rate This App"
        android:icon="@drawable/star" />
    <item
        android:id="@+id/action_quit"
        android:orderInCategory="400"
        android:showAsAction="never"
        android:title="Quit"
        android:icon="@drawable/quit" />

</menu>

Part of the Java code:

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);

    //Set icon for the menu button
    Drawable icon = getResources().getDrawable(R.drawable.icon);
    menu.getItem(0).setIcon(icon);

    return true;
}

I still don't see the icon on the menu. I'm running phone and AVD 4.2+. Has Google removed menu icon support?

Matt Robertson

Hope this is a stupid question, but do you have an icon image in your drawable folder with a name to access it?

If everything is set up correctly, try cleaning your project and running it again (make sure to build as well).

Related


Add custom icon for bloat menu

Silicon 8 I'm trying to add an icon to a menu (because it looks boring) my menu xml: <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/action_about" android:orderInCategory="200" android:showA

Add icon to TinyMCE custom menu

work for life I'm modifying a plugin that adds a custom TinyMCE menu in WP. I need to be able to add icons to dropdown menu items and submenu items. I have icons enabled, which add space to it in the HTML, but can't figure out where JS can put them in. createC

Add icon to TinyMCE custom menu

work for life I'm modifying a plugin that adds a custom TinyMCE menu in WP. I need to be able to add icons to dropdown menu items and submenu items. I have icons enabled, which add space to it in the HTML, but can't figure out where JS can put them in. createC

Add icon to TinyMCE custom menu

work for life I'm modifying a plugin that adds a custom TinyMCE menu in WP. I need to be able to add icons to dropdown menu items and submenu items. I have icons enabled, which add space to it in the HTML, but can't figure out where JS can put them in. createC

How to add custom image/icon in ANTD design menu?

Johnny Shruder Using this example : https://ant.design/components/layout/#components-layout-demo-side How to add custom image or icon instead of default icon. I tried: <Menu.Item to="/" key="2"> <img className="ant-menu-item" src={require('image.png')} />

How to add custom image/icon in ANTD design menu?

Johnny Shruder Using this example : https://ant.design/components/layout/#components-layout-demo-side How to add custom image or icon instead of default icon. I tried: <Menu.Item to="/" key="2"> <img className="ant-menu-item" src={require('image.png')} />

How to add custom image/icon in ANTD design menu?

Johnny Shruder Using this example : https://ant.design/components/layout/#components-layout-demo-side How to add custom image or icon instead of default icon. I tried: <Menu.Item to="/" key="2"> <img className="ant-menu-item" src={require('image.png')} />

ResourceNotFoundException on bloat menu

Amor Borka I am trying to implement a searchview, as per the documentation I have added options_menu.xml to my project: <?xml version="1.0" encoding="utf-8"?> <resources> <menu xmlns:android="http://schemas.android.com/apk/res/android" name="options_menu">

Apache Isis custom menu icon

sex song I would like to use the FoneAwesome icon to change the default menu icon like Day Day Calendar uses the calendaricon. sex song I just solved this with a very simple solution that already exists Apache Isis, just using annotations cssClassFaon ActionLa

Apache Isis custom menu icon

sex song I would like to use the FoneAwesome icon to change the default menu icon like Day Day Calendar uses the calendaricon. sex song I just solved this with a very simple solution that already exists Apache Isis, just using annotations cssClassFaon ActionLa

Apache Isis custom menu icon

sex song I would like to use the FoneAwesome icon to change the default menu icon like Day Day Calendar uses the calendaricon. sex song I just solved this with a very simple solution that already exists Apache Isis, just using annotations cssClassFaon ActionLa

Apache Isis custom menu icon

sex song I would like to use the FoneAwesome icon to change the default menu icon like Day Day Calendar uses the calendaricon. sex song I just solved this with a very simple solution that already exists Apache Isis, just using annotations cssClassFaon ActionLa

Apache Isis custom menu icon

sex song I would like to use the FoneAwesome icon to change the default menu icon like Day Day Calendar uses the calendaricon. sex song I just solved this with a very simple solution that already exists Apache Isis, just using annotations cssClassFaon ActionLa

Apache Isis custom menu icon

sex song I would like to use the FoneAwesome icon to change the default menu icon like Day Day Calendar uses the calendaricon. sex song I just solved this with a very simple solution that already exists Apache Isis, just using annotations cssClassFaon ActionLa

Add custom icon to matIconRegistry?

Yes I'm trying to use the method in the answer to this SO question to implement a custom material icon as shown in this Stackblitz . But it renders the error: Error retrieving icon: Unable to find icon with the name ":circle-icon" idea? Christopher Paceret As

Add custom icon to matIconRegistry?

Yes I'm trying to use the method in the answer to this SO question to implement a custom material icon as shown in this Stackblitz . But it renders the error: Error retrieving icon: Unable to find icon with the name ":circle-icon" idea? Christopher Paceret As

Tkinter: add icon to menu item

Dylan Logan I have a fully functional TkInter right click context menu with 4 items and 1 separator, but I'm trying to figure out how to display icons in each item, I managed to get the items to display as icons, but remove the actual Visibility of text, which

Tkinter: add icon to menu item

Dylan Logan I have a fully functional TkInter right click context menu with 4 items and 1 separator, but I'm trying to figure out how to display icons in each item, I managed to get the items to display as icons, but remove the actual Visibility of text, which

Tkinter: add icon to menu item

Dylan Logan I have a fully functional TkInter right click context menu with 4 items and 1 separator, but I'm trying to figure out how to display icons in each item, I managed to get the items to display as icons, but remove the actual Visibility of text, which

Tkinter: add icon to menu item

Dylan Logan I have a fully functional TkInter right click context menu with 4 items and 1 separator, but I'm trying to figure out how to display icons in each item, I managed to get the items to display as icons, but removing the actual Visibility of text, whi

Tkinter: add icon to menu item

Dylan Logan I have a fully functional TkInter right click context menu with 4 items and 1 separator, but I'm trying to figure out how to display icons in each item, I managed to get the items to display as icons, but removing the actual Visibility of text, whi

Add style to custom menu

Rostislav Olszewski I can render the menu "main menu": <?php if ($main_menu): ?> <?php print theme('links__system_main_menu', array( 'links' => $main_menu, 'attributes' => array( 'id' => 'main-menu-links', 'class' =>

Add style to custom menu

Rostislav Olszewski I can render the menu "main menu": <?php if ($main_menu): ?> <?php print theme('links__system_main_menu', array( 'links' => $main_menu, 'attributes' => array( 'id' => 'main-menu-links', 'class' =>

Add custom icon to tinyMCE button

captis I'm trying to add a Font-Awsome icon to a button I've added to tinyMCE, thus: ed.addButton('youtube', { title: 'Add Video' , icon: 'icon-youtube', onclick: function () { //do stuff here... } Using images like the docs is not accep

Add custom icon to tinyMCE button

captiz I'm trying to add a Font-Awsome icon to a button I've added to tinyMCE: ed.addButton('youtube', { title: 'Add Video' , icon: 'icon-youtube', onclick: function () { //do stuff here... } Using images like the docs is not acceptable,

Ionic: How to add custom icon?

Murgard How to add custom icon to ionic? I haven't been able to find a step-by-step how-to. There are a lot of really basic icons (eg paragraph icons) that are not provided by ionicon, so I have to add them myself somehow. cfprabhu Download fonts to include in

Add custom icon to tinyMCE button

captis I'm trying to add a Font-Awsome icon to a button I've added to tinyMCE, thus: ed.addButton('youtube', { title: 'Add Video' , icon: 'icon-youtube', onclick: function () { //do stuff here... } Using images like the docs is not accep