private void createNavDrawerItems(){
        if (mDrawerItemsListContainer == null) {
            return;
        }

        mNavDrawerItemViews.clear();
        mDrawerItemsListContainer.removeAllViews();
        for (DrawerItem item: mDrawerItems) {
            item.setSelected(item.getId() == mSelectedItem);
            View view = item.onCreateView(mActivity.getLayoutInflater(),
                    mDrawerItemsListContainer, mConfig.getItemHighlightColor(mActivity));
            if(!(item instanceof SeperatorDrawerItem)){
                view.setId(item.getId());
                mNavDrawerItemViews.put(item.getId(), view);
                mNavDrawerItems.put(item.getId(), item);

                // Set the view's click listener
                if(!(item instanceof SwitchDrawerItem)) {
                    view.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            onNavDrawerItemClicked(v.getId());
                        }
                    });
                }

            }

            mDrawerItemsListContainer.addView(view);
        }
    }
private void createNavDrawerItems ( ) { if ( mDrawerItemsListContainer == null ) { return ; } mNavDrawerItemViews . clear ( ) ; mDrawerItemsListContainer . removeAllViews ( ) ; for ( DrawerItem item : mDrawerItems ) { item . setSelected ( item . getId ( ) == mSelectedItem ) ; View view = item . onCreateView ( mActivity . getLayoutInflater ( ) , mDrawerItemsListContainer , mConfig . getItemHighlightColor ( mActivity ) ) ; if ( ! ( item instanceof SeperatorDrawerItem ) ) { view . setId ( item . getId ( ) ) ; mNavDrawerItemViews . put ( item . getId ( ) , view ) ; mNavDrawerItems . put ( item . getId ( ) , item ) ; if ( ! ( item instanceof SwitchDrawerItem ) ) { view . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { onNavDrawerItemClicked ( v . getId ( ) ) ; } } ) ; } } mDrawerItemsListContainer . addView ( view ) ; } }
Populate the nav drawer items into the view