code: @Override
      public void inflate(int menuRes, Menu menu) {
          // If we're not dealing with a SupportMenu instance, let super handle
          if (!(menu instanceof SupportMenu)) {
              super.inflate(menuRes, menu);
              return;
          }
  
          XmlResourceParser parser = null;
          try {
              parser = mContext.getResources().getLayout(menuRes);
              AttributeSet attrs = Xml.asAttributeSet(parser);
  
              parseMenu(parser, attrs, menu);
          } catch (XmlPullParserException e) {
              throw new InflateException("Error inflating menu XML", e);
          } catch (IOException e) {
              throw new InflateException("Error inflating menu XML", e);
          } finally {
              if (parser != null) parser.close();
          }
      }
docs: Inflate a menu hierarchy from the specified XML resource. Throws
  {@link InflateException} if there is an error.
  
  @param menuRes Resource ID for an XML layout resource to load (e.g.,
  <code>R.menu.main_activity</code>)
  @param menu    The Menu to inflate into. The items and submenus will be
  added to this Menu.