Code example for ArrayList

Methods: size

0
 
        public int getCount() { 
            ArrayList<MenuItemImpl> items = mOverflowOnly ?
                    mAdapterMenu.getNonActionItems() : mAdapterMenu.getVisibleItems();
            if (mExpandedIndex < 0) {
                return items.size();
            } 
            return items.size() - 1;
        } 
 
        public MenuItemImpl getItem(int position) {
            ArrayList<MenuItemImpl> items = mOverflowOnly ?
                    mAdapterMenu.getNonActionItems() : mAdapterMenu.getVisibleItems();
            if (mExpandedIndex >= 0 && position >= mExpandedIndex) {
                position++;
            } 
            return items.get(position);
        } 
 
        public long getItemId(int position) {
            // Since a menu item's ID is optional, we'll use the position as an