/**
  * Dismiss all submenu popups.
  *
  * @return true if popups were dismissed, false otherwise. (This can be because none were open.)
  */
 public boolean hideSubMenus() {
   if (mActionButtonPopup != null) {
     mActionButtonPopup.dismiss();
     return true;
   }
   return false;
 }
  public boolean onSubMenuSelected(SubMenuBuilder subMenu) {
    if (!subMenu.hasVisibleItems()) return false;

    SubMenuBuilder topSubMenu = subMenu;
    while (topSubMenu.getParentMenu() != mMenu) {
      topSubMenu = (SubMenuBuilder) topSubMenu.getParentMenu();
    }
    View anchor = findViewForItem(topSubMenu.getItem());
    if (anchor == null) {
      if (mOverflowButton == null) return false;
      anchor = mOverflowButton;
    }

    mOpenSubMenuId = subMenu.getItem().getItemId();
    mActionButtonPopup = new ActionButtonSubmenu(mContext, subMenu);
    mActionButtonPopup.setAnchorView(anchor);
    mActionButtonPopup.show();
    super.onSubMenuSelected(subMenu);
    return true;
  }