title: Badge on BottomNavigationView
body: <p>I am trying to add a badge to the <code>BottomNavigationView</code> Item without using any library, however somehow the <code>BottomNavigationView</code> is not showing the badge (custom_view)</p>
  
  <p>main_view.xml:</p>
  
  <pre><code> &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.hrskrs.test.MainActivity"&gt;
  
    &lt;FrameLayout
      android:id="@+id/container"
      android:layout_width="match_parent"
      android:layout_height="match_parent" /&gt;
  
    &lt;android.support.design.widget.BottomNavigationView
      android:id="@+id/bottom_navigation"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      app:itemBackground="@color/colorPrimary"
      app:itemIconTint="@color/colorAccent"
      app:itemTextColor="@color/colorPrimaryDark"
      app:menu="@menu/bottom_navigation_main" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>bottom_navigation_menu.xml:</p>
  
  <pre><code>    &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
    &lt;item
      android:id="@+id/item_test"
      android:icon="@mipmap/ic_launcher"
      android:title="action1"
      app:showAsAction="always" /&gt;
  
    &lt;item
      android:enabled="true"
      android:icon="@mipmap/ic_launcher"
      android:title="action2"
      app:showAsAction="ifRoom" /&gt;
  
    &lt;item
      android:enabled="true"
      android:icon="@mipmap/ic_launcher"
      android:title="action3"
      app:showAsAction="ifRoom" /&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p>Activity extended from <code>AppCompatActivity</code>:</p>
  
  <pre><code>@Override
    public boolean onCreateOptionsMenu(Menu menu) {
      menu = bottomNavigationView.getMenu();
      menu.clear();
      getMenuInflater().inflate(R.menu.bottom_navigation_main, menu);
      MenuItem item = menu.findItem(R.id.item_test);
      item = MenuItemCompat.setActionView(item, R.layout.custom_view);
      RelativeLayout badgeWrapper = (RelativeLayout) MenuItemCompat.getActionView(item);
  
      TextView textView = (TextView) badgeWrapper.findViewById(R.id.txtCount);
      textView.setText("99+");
  
      return super.onCreateOptionsMenu(menu);
    }
  </code></pre>
  
  <p>custom_view.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    style="@android:style/Widget.ActionButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@android:color/transparent"
    android:clickable="true"
    android:gravity="center"
    android:orientation="vertical"&gt;
  
    &lt;ImageView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:contentDescription="Notification Icon"
      android:gravity="center"
      android:src="@mipmap/ic_launcher" /&gt;
  
    &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/txtCount"
      android:gravity="right"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:background="@drawable/ic_badge"
      android:text="55"
      android:textColor="#ffffffff"
      android:textSize="12sp" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Istead of showing <code>(badge) custom_view</code> it shows the item itself only:</p>
  
  <p><a href="https://i.stack.imgur.com/SLv3a.png" rel="noreferrer"><img src="https://i.stack.imgur.com/SLv3a.png" alt="enter image description here"></a></p>
  
  <p>Below you can see from the debug mode that the <code>view</code> accessed is the right one and it is being set correctly. However somehow the <code>BottomNavigationView</code>is not being invalidated:</p>
  
  <p><a href="https://i.stack.imgur.com/mY2wQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mY2wQ.png" alt="enter image description here"></a></p>