public static MenuDrawer attach(Activity activity, Type type, Position position, int dragMode) {
        MenuDrawer menuDrawer = createMenuDrawer(activity, dragMode, position, type);
        menuDrawer.setId(R.id.md__drawer);

        switch (dragMode) {
            case MenuDrawer.MENU_DRAG_CONTENT:
                attachToContent(activity, menuDrawer);
                break;

            case MenuDrawer.MENU_DRAG_WINDOW:
                attachToDecor(activity, menuDrawer);
                break;

            default:
                throw new RuntimeException("Unknown menu mode: " + dragMode);
        }

        return menuDrawer;
    }
Attaches the MenuDrawer to the Activity.

@param activity The activity the menu drawer will be attached to.
@param type     The {@link Type} of the drawer.
@param position Where to position the menu.
@param dragMode The drag mode of the drawer. Can be either {@link MenuDrawer#MENU_DRAG_CONTENT}
                or {@link MenuDrawer#MENU_DRAG_WINDOW}.
@return The created MenuDrawer instance.
menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java