0

I'm using topup sub-menu item by group in menu item. I have created group item menu as given below menu xml code.

<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:cycle="http://schemas.android.com/apk/res-auto" >

<group>

        <item
            android:id="@+id/bookAppt"
            android:icon="@drawable/addsomething_gray"
            android:orderInCategory="1"
            android:title="Book Appointment"
            cycle:showAsAction="never"/>
        <item
            android:id="@+id/refreshAppt"
            android:icon="@drawable/refresh_icon_dark"
            android:orderInCategory="2"
            android:title="Refresh"
            cycle:showAsAction="never"/>

</group>

Every thing going perfect but submenu item icon not showing. Can anyone guide me regarding this issue. Thanks

  • Pop up menus have no icons. See http://stackoverflow.com/questions/8908985/android-options-menu-icon-wont-display . Please refer to http://stackoverflow.com/questions/6805756/is-it-possible-to-display-icons-in-a-popupmenu and http://stackoverflow.com/questions/20836385/popup-menu-with-icon-on-android for workarounds – headuck Sep 15 '15 at 19:18
  • ok, thanks to reply. – Er Ritesh singh Sep 16 '15 at 06:19

2 Answers2

0

In your code change this cycle:showAsAction="never" to cycle:showAsAction="always".

ricardopereira
  • 11,118
  • 5
  • 63
  • 81
0

replace cycle:showAsAction="never" with app:showAsAction="ifRoom|always"

Mrunal Chauhan
  • 51
  • 1
  • 12