I am trying to show a custom layout as an item in the options menu. And this is what I have done so far
<item android:id="@+id/action_profile" android:orderInCategory="100" android:title="Profile" android:actionLayout="@layout/layout_menu_profile" app:showAsAction="never" />
I tried
app:actionLayout="@layout/layout_menu_profile"
and also for this SO link, but still it only shows the title - Profile
I created a new project through Android Studio 1.5 with Blank Activity. with minSDK = 15 and targetSDK = 23
Below is the code in Blank Activity.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_home, menu); MenuItem item = menu.findItem(R.id.action_profile); return true; }
where am i wrong
source share