Android OnCreateOptionsMenu Item with actionLayout not working
<p>I need to display a layout inside my option menu.</p>

<p><strong>menu.xml</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;item
        android:id="@+id/action_likes"
        android:showAsAction="never"
        android:actionLayout="@layout/likes_layout"/&gt;

    &lt;item
        android:id="@+id/settings"
        android:showAsAction="never"
        android:title="Settings"
        /&gt;
&lt;/menu&gt;
</code></pre>

<p><strong>shape_notification.xml</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval"&gt;
    &lt;stroke android:color="#080808" android:width="2dp"/&gt;
    &lt;corners android:radius="5dp" /&gt;
    &lt;solid android:color="#85ea32"/&gt;
&lt;/shape&gt;
</code></pre>

<p><strong>likes_layout.xml</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;

    &lt;TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="3"
        android:id="@+id/likes"
        android:linksClickable="false"
        android:text="Likes"
        android:gravity="center_vertical|center_horizontal"
        android:textAppearance="?android:attr/textAppearanceLarge" /&gt;

    &lt;Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="5"
        android:layout_gravity="center"
        android:id="@+id/notif_count"
        android:background="@drawable/shape_notification"
        android:text="0"
        android:textSize="16sp"
        android:gravity="center"
        android:padding="2dp"
        android:singleLine="true"
        android:layout_margin="5dp"
        android:textColor="#fff"/&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p><strong>MainActivity.java</strong></p>

<pre><code>public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.menu, menu);

        return true;
    }
}
</code></pre>

<p>Option list is visible. Setting item is visible but likes layout is blank.</p>

<p>Does any one have done action layout for hidden items? Please help me</p>