code: public void createMenu(int menuId){
          mToolbar.inflateMenu(menuId);
          mMenuDataChanged = true;
          if(mAppCompatDelegate == null)
              onPrepareMenu();
      }
docs: This funcction should be called in onCreateOptionsMenu of Activity or Fragment to inflate a new menu.
  @param menuId