public MenuItemImpl getItem(int position) {
   ArrayList<MenuItemImpl> items =
       mOverflowOnly ? mAdapterMenu.getNonActionItems() : mAdapterMenu.getVisibleItems();
   if (mExpandedIndex >= 0 && position >= mExpandedIndex) {
     position++;
   }
   return items.get(position);
 }
 public int getCount() {
   ArrayList<MenuItemImpl> items =
       mOverflowOnly ? mAdapterMenu.getNonActionItems() : mAdapterMenu.getVisibleItems();
   if (mExpandedIndex < 0) {
     return items.size();
   }
   return items.size() - 1;
 }