I'm trying to use my own layout (R.layout.update_button
) as an action bar menu item view.
The item declation is as follows:
<item
android:id="@+id/menu_update"
android:checkable="true"
android:showAsAction="never"
android:title="Title"/>
With the following code on the onCreateOptionsMenu(Menu menu)
:
View updateView = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE))
.inflate(R.layout.update_button, null);
update.setActionView(updateView);
The problem is that tihis only works when android:showAsAction
is set to always
. However when it is set to never
, I only see the menu title ("Title") without any custom layout of mine.
Is there a way to show the custom layout even when showAsAction="never"
?