Code example for Menu

Methods: clear

0
    } 
 
    @Override 
    public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
        boolean isEditableNow = mActionHandler.isSelectionEditable();
        if (mEditable != isEditableNow) {
            mEditable = isEditableNow;
            menu.clear();
            createActionMenu(mode, menu);
            return true; 
        } 
        return false; 
    } 
 
    private void createActionMenu(ActionMode mode, Menu menu) {
        TypedArray styledAttributes = getContext().obtainStyledAttributes(ACTION_MODE_ATTRS);
 
        menu.add(Menu.NONE, ID_SELECTALL, Menu.NONE, android.R.string.selectAll).
            setAlphabeticShortcut('a').
            setIcon(styledAttributes.getResourceId(SELECT_ALL_ATTR_INDEX, 0)).
            setShowAsAction(