I want to display a custom submenu item. The menu is inflated and menu items are created. But the submenu created with android:actionLayout is empty / empty.
I am using ActionBarSherlock 4.3.
What am I missing here?
This is my menu.xml
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:icon="@drawable/action_bar_overflow_icon" android:showAsAction="always"> <menu> <item android:id="@+id/menu_item_view_reserve" android:actionLayout="@layout/item_edit_reserve" /> <item android:id="@+id/menu_item_view_delete" android:icon="@drawable/item_manage_icon_delete" android:title="Delete" /> </menu> </item> </menu>
This is my layout / item _edit_reserve.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/item_manage_icon_reserved" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@android:color/black" android:text="Reserve"/> </RelativeLayout>
Bloating:
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.item_edit, menu); }
source share