Example usage for android.view MenuItem SHOW_AS_ACTION_NEVER

List of usage examples for android.view MenuItem SHOW_AS_ACTION_NEVER

Introduction

In this page you can find the example usage for android.view MenuItem SHOW_AS_ACTION_NEVER.

Prototype

int SHOW_AS_ACTION_NEVER

To view the source code for android.view MenuItem SHOW_AS_ACTION_NEVER.

Click Source Link

Document

Never show this item as a button in an Action Bar.

Usage

From source file:org.catnut.fragment.ProfileFragment.java

private void buildMenu() {
    if (mMenu != null && mAvatarUrl != null) { // ???sqlite
        // ???menu
        if (mMenu.findItem(R.id.action_follow) == null && mMenu.findItem(R.id.action_unfollow) == null) {
            if (!mFollowing) {
                mMenu.add(Menu.NONE, R.id.action_follow, Menu.NONE, R.string.follow)
                        .setIcon(R.drawable.ic_title_follow).setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
            } else {
                mMenu.add(Menu.NONE, R.id.action_unfollow, Menu.NONE, R.string.unfollow)
                        .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
            }//ww  w  .j  a  v  a 2 s .c  o m
        }
    }
}

From source file:org.transdroid.core.gui.TorrentsActivity.java

@Override
public boolean onPrepareOptionsMenu(Menu menu) {
    super.onPrepareOptionsMenu(menu);

    // No connection yet; hide all menu options except settings
    if (currentConnection == null) {
        torrentsToolbar.setNavigationIcon(null);
        if (selectionToolbar != null)
            selectionToolbar.setVisibility(View.GONE);
        addmenuButton.setVisibility(View.GONE);
        actionsToolbar.setVisibility(View.GONE);
        if (filtersList != null)
            filtersList.setVisibility(View.GONE);
        filterSearch.setVisibility(View.GONE);
        torrentsToolbar.getMenu().findItem(R.id.action_search).setVisible(false);
        torrentsToolbar.getMenu().findItem(R.id.action_rss).setVisible(false);
        torrentsToolbar.getMenu().findItem(R.id.action_settings)
                .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
        torrentsToolbar.getMenu().findItem(R.id.action_help).setVisible(true);
        actionsToolbar.getMenu().findItem(R.id.action_enableturtle).setVisible(false);
        actionsToolbar.getMenu().findItem(R.id.action_disableturtle).setVisible(false);
        actionsToolbar.getMenu().findItem(R.id.action_refresh).setVisible(false);
        actionsToolbar.getMenu().findItem(R.id.action_sort).setVisible(false);
        if (fragmentTorrents != null) {
            fragmentTorrents.updateConnectionStatus(false, null);
        }/*from   ww  w  .  ja  v  a  2s . c  om*/
        return true;
    }

    // There is a connection (read: settings to some server known)
    if (drawerToggle != null)
        torrentsToolbar.setNavigationIcon(R.drawable.ic_action_drawer);
    if (selectionToolbar != null)
        selectionToolbar.setVisibility(View.VISIBLE);
    addmenuButton.setVisibility(View.VISIBLE);
    actionsToolbar.setVisibility(View.VISIBLE);
    if (filtersList != null)
        filtersList.setVisibility(View.VISIBLE);
    filterSearch.setVisibility(View.VISIBLE);
    boolean addByFile = Daemon.supportsAddByFile(currentConnection.getType());
    addmenuFileButton.setVisibility(addByFile ? View.VISIBLE : View.GONE);
    // Primary toolbar menu
    torrentsToolbar.getMenu().findItem(R.id.action_search).setVisible(navigationHelper.enableSearchUi());
    torrentsToolbar.getMenu().findItem(R.id.action_rss).setVisible(navigationHelper.enableRssUi());
    torrentsToolbar.getMenu().findItem(R.id.action_settings).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
    torrentsToolbar.getMenu().findItem(R.id.action_help).setVisible(false);
    // Secondary toolbar menu
    boolean hasAltMode = Daemon.supportsSetAlternativeMode(currentConnection.getType());
    actionsToolbar.getMenu().findItem(R.id.action_enableturtle).setVisible(hasAltMode && !turtleModeEnabled);
    actionsToolbar.getMenu().findItem(R.id.action_disableturtle).setVisible(hasAltMode && turtleModeEnabled);
    actionsToolbar.getMenu().findItem(R.id.action_refresh).setVisible(true);
    actionsToolbar.getMenu().findItem(R.id.action_sort).setVisible(true);
    actionsToolbar.getMenu().findItem(R.id.action_sort_added)
            .setVisible(Daemon.supportsDateAdded(currentConnection.getType()));
    if (fragmentTorrents != null) {
        fragmentTorrents.updateConnectionStatus(true, currentConnection.getType());
    }

    return true;
}

From source file:apps.junkuvo.alertapptowalksafely.MainActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {

    // ??/*from   w  w w  .  j av a 2 s .co  m*/
    MenuItem actionItem = menu.add(Menu.NONE, MENU_ID.SETTING.ordinal(), MENU_ID.SETTING.ordinal(),
            this.getString(R.string.menu_title_setting));
    actionItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
    actionItem.setIcon(MENU_ID.SETTING.getDrawableResId());

    // Twitter?
    actionItem = menu.add(Menu.NONE, MENU_ID.TWITTER.ordinal(), MENU_ID.TWITTER.ordinal(),
            this.getString(R.string.menu_title_share));
    actionItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
    actionItem.setIcon(MENU_ID.TWITTER.getDrawableResId());

    // Facebook
    actionItem = menu.add(Menu.NONE, MENU_ID.FACEBOOK.ordinal(), MENU_ID.FACEBOOK.ordinal(),
            this.getString(R.string.menu_title_facebook));
    actionItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
    actionItem.setIcon(MENU_ID.FACEBOOK.getDrawableResId());

    if (enableNewFunction) {
        // HISTORY
        actionItem = menu.add(Menu.NONE, MENU_ID.HISTORY.ordinal(), MENU_ID.HISTORY.ordinal(),
                this.getString(R.string.menu_title_history));
        actionItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
        actionItem.setIcon(MENU_ID.HISTORY.getDrawableResId());

    }

    // LINE
    actionItem = menu.add(Menu.NONE, MENU_ID.LINE.ordinal(), MENU_ID.LINE.ordinal(),
            this.getString(R.string.menu_title_line));
    actionItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
    actionItem.setIcon(MENU_ID.LINE.getDrawableResId());

    // FEEDBACK
    actionItem = menu.add(Menu.NONE, MENU_ID.FEEDBACK.ordinal(), MENU_ID.FEEDBACK.ordinal(),
            this.getString(R.string.menu_title_feedback));
    actionItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
    actionItem.setIcon(MENU_ID.FEEDBACK.getDrawableResId());

    // LICENSE
    actionItem = menu.add(Menu.NONE, MENU_ID.LICENSE.ordinal(), MENU_ID.LICENSE.ordinal(),
            this.getString(R.string.menu_title_license));
    actionItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
    actionItem.setIcon(MENU_ID.LICENSE.getDrawableResId());

    return true;
}

From source file:org.alfresco.mobile.android.application.fragments.search.SearchFragment.java

public static void getMenu(Menu menu) {
    MenuItem mi = menu.add(Menu.NONE, R.id.menu_search_option, Menu.FIRST, R.string.search_advanced);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
}

From source file:org.catnut.fragment.ProfileFragment.java

private void toggleFollow(final boolean follow) {
    mApp.getRequestQueue()/* www.j a va 2s.  c om*/
            .add(new CatnutRequest(getActivity(),
                    follow ? FriendshipsAPI.create(mScreenName, null) : FriendshipsAPI.destroy(mScreenName),
                    new UserProcessor.UserProfileProcessor(), new Response.Listener<JSONObject>() {
                        @Override
                        public void onResponse(JSONObject response) {
                            Toast.makeText(getActivity(),
                                    getString(follow ? R.string.follow_success : R.string.unfollow_success),
                                    Toast.LENGTH_SHORT).show();
                            if (follow) {
                                mMenu.removeItem(R.id.action_follow);
                                mMenu.add(Menu.NONE, R.id.action_follow, Menu.NONE, R.string.unfollow)
                                        .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
                            } else {
                                mMenu.removeItem(R.id.action_unfollow);
                                mMenu.add(Menu.NONE, R.id.action_follow, Menu.NONE, R.string.follow)
                                        .setIcon(R.drawable.ic_title_follow)
                                        .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
                            }
                            mFollowing = !mFollowing;
                            // ?
                            final String str = follow ? "+1" : "-1";
                            new Thread(new Runnable() {
                                @Override
                                public void run() {
                                    long uid = mApp.getAccessToken().uid;
                                    String update = "update " + User.TABLE + " SET " + User.friends_count + "="
                                            + User.friends_count + str + " WHERE " + BaseColumns._ID + "="
                                            + uid;
                                    getActivity().getContentResolver().update(
                                            CatnutProvider.parse(User.MULTIPLE, uid), null, update, null);
                                }
                            }).start();
                        }
                    }, new Response.ErrorListener() {
                        @Override
                        public void onErrorResponse(VolleyError error) {
                            Toast.makeText(getActivity(), error.getLocalizedMessage(), Toast.LENGTH_SHORT)
                                    .show();
                        }
                    }));
}

From source file:org.alfresco.mobile.android.application.fragments.menu.MainMenuFragment.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    menu.clear();/*from   w w  w  . j  a  v a  2  s .  c  o  m*/

    if (showOperationsMenu) {
        MenuItem mi = menu.add(Menu.NONE, R.id.menu_notifications, Menu.FIRST, R.string.notifications);
        mi.setIcon(R.drawable.ic_events_dark);
        mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
    }
}

From source file:org.nla.tarotdroid.lib.ui.GameSetHistoryActivity.java

@Override
public boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu) {

    SubMenu subMenuBlueTooth = menu.addSubMenu(this.getString(R.string.lblBluetoothItem));
    com.actionbarsherlock.view.MenuItem miBluetooth = subMenuBlueTooth.getItem();
    miBluetooth.setIcon(R.drawable.stat_sys_data_bluetooth);
    miBluetooth.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);

    com.actionbarsherlock.view.MenuItem miBlueToothDiscover = subMenuBlueTooth
            .add(R.string.lblBluetoothDiscover).setIcon(R.drawable.ic_menu_allfriends);
    com.actionbarsherlock.view.MenuItem miBlueToothGetDiscoverable = subMenuBlueTooth
            .add(R.string.lblBluetoothGetDiscoverable).setIcon(android.R.drawable.ic_menu_myplaces);
    com.actionbarsherlock.view.MenuItem miBlueToothReceive = subMenuBlueTooth.add(R.string.lblBluetoothReceive)
            .setIcon(R.drawable.ic_menu_download);
    com.actionbarsherlock.view.MenuItem miBlueToothHelp = subMenuBlueTooth.add(R.string.lblBluetoothHelp)
            .setIcon(android.R.drawable.ic_menu_info_details);

    miBlueToothDiscover.setOnMenuItemClickListener(new OnMenuItemClickListener() {
        @Override/*from w w  w .ja  v a 2  s .c om*/
        public boolean onMenuItemClick(com.actionbarsherlock.view.MenuItem item) {
            if (isBluetoothActivated()) {
                GameSetHistoryActivity.this.bluetoothHelper.startDiscovery();
                AuditHelper.auditEvent(AuditHelper.EventTypes.actionBluetoothDiscoverDevices);
            }
            return true;
        }
    });

    miBlueToothGetDiscoverable.setOnMenuItemClickListener(new OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(com.actionbarsherlock.view.MenuItem item) {
            if (isBluetoothActivated()) {
                GameSetHistoryActivity.this.bluetoothHelper.setBluetoothDeviceDiscoverable();
                AuditHelper.auditEvent(AuditHelper.EventTypes.actionBluetoothSetDiscoverable);
            }
            return true;
        }
    });

    miBlueToothReceive.setOnMenuItemClickListener(new OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(com.actionbarsherlock.view.MenuItem item) {
            if (isBluetoothActivated()) {
                // retrieve game count
                int gameSetCount;
                try {
                    gameSetCount = AppContext.getApplication().getDalService().getGameSetCount();
                } catch (DalException de) {
                    gameSetCount = 0;
                }

                // prevent user from downloading if game set count > 5 and
                // limited version
                if (AppContext.getApplication().isAppLimited() && gameSetCount >= 5) {
                    Toast.makeText(GameSetHistoryActivity.this,
                            AppContext.getApplication().getResources()
                                    .getString(R.string.msgLimitedVersionInformation),
                            Toast.LENGTH_SHORT).show();
                }

                // ok for download
                else {
                    try {
                        GameSetHistoryActivity.this.receiveGameSetTask = new ReceiveGameSetTask(
                                GameSetHistoryActivity.this, GameSetHistoryActivity.this.progressDialog,
                                GameSetHistoryActivity.this.bluetoothHelper.getBluetoothAdapter());
                        GameSetHistoryActivity.this.receiveGameSetTask.setCallback(refreshCallback);
                        GameSetHistoryActivity.this.receiveGameSetTask.execute();
                        AuditHelper.auditEvent(AuditHelper.EventTypes.actionBluetoothReceiveGameSet);
                    } catch (IOException ioe) {
                        Log.v(AppContext.getApplication().getAppLogTag(),
                                "TarotDroid Exception in " + this.getClass().toString(), ioe);
                        Toast.makeText(GameSetHistoryActivity.this, AppContext.getApplication().getResources()
                                .getString(R.string.msgBluetoothError, ioe), Toast.LENGTH_SHORT).show();
                    }
                }
            }
            return true;
        }
    });

    miBlueToothHelp.setOnMenuItemClickListener(new OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(com.actionbarsherlock.view.MenuItem item) {
            UIHelper.showSimpleRichTextDialog(GameSetHistoryActivity.this,
                    AppContext.getApplication().getResources().getText(R.string.msgHelpBluetooth).toString(),
                    AppContext.getApplication().getResources().getString(R.string.titleHelpBluetooth));
            return true;
        }
    });

    // TODO Improve Massive excel export
    // if (!AppContext.getApplication().isAppLimited()) {
    // com.actionbarsherlock.view.MenuItem miGlobalExport =
    // menu.add(this.getString(R.string.lblExcelExport)).setIcon(R.drawable.ic_excel);
    // miGlobalExport.setShowAsAction(com.actionbarsherlock.view.MenuItem.SHOW_AS_ACTION_NEVER);
    // //miGlobalExport.setIcon(R.drawable.ic_excel);
    //
    // miGlobalExport.setOnMenuItemClickListener(new
    // OnMenuItemClickListener() {
    // @Override
    // public boolean onMenuItemClick(com.actionbarsherlock.view.MenuItem
    // item) {
    // ExportToExcelTask task = new
    // ExportToExcelTask(GameSetHistoryActivity.this, progressDialog);
    // task.execute();
    // return true;
    // }
    // });
    // }

    com.actionbarsherlock.view.MenuItem miBin = menu.add(this.getString(R.string.lblInitDalItem));
    miBin.setShowAsAction(com.actionbarsherlock.view.MenuItem.SHOW_AS_ACTION_NEVER);
    miBin.setIcon(R.drawable.gd_action_bar_trashcan);

    miBin.setOnMenuItemClickListener(new OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(com.actionbarsherlock.view.MenuItem item) {
            AlertDialog.Builder builder = new AlertDialog.Builder(GameSetHistoryActivity.this);
            builder.setTitle(GameSetHistoryActivity.this.getString(R.string.titleReinitDalYesNo));
            builder.setMessage(
                    Html.fromHtml(GameSetHistoryActivity.this.getText(R.string.msgReinitDalYesNo).toString()));
            builder.setPositiveButton(GameSetHistoryActivity.this.getString(R.string.btnOk),
                    GameSetHistoryActivity.this.removeAllGameSetsDialogClickListener);
            builder.setNegativeButton(GameSetHistoryActivity.this.getString(R.string.btnCancel),
                    GameSetHistoryActivity.this.removeAllGameSetsDialogClickListener).show();
            builder.setIcon(android.R.drawable.ic_dialog_alert);
            return true;
        }
    });

    return true;
}

From source file:org.alfresco.mobile.android.application.fragments.browser.ChildrenBrowserFragment.java

public void getMenu(Menu menu) {
    if (parentFolder == null) {
        return;/*from  w  w  w  . j a  va  2  s  .c o m*/
    }

    if (getActivity() instanceof MainActivity) {
        getMenu(alfSession, menu, parentFolder);

        if (hasDocument()) {
            displayMenuItem = menu.add(Menu.NONE, MenuActionItem.MENU_DISPLAY_GALLERY,
                    Menu.FIRST + MenuActionItem.MENU_DISPLAY_GALLERY, R.string.display_gallery);
            displayMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
        }
    } else if (getActivity() instanceof PublicDispatcherActivity) {
        Permissions permission = alfSession.getServiceRegistry().getDocumentFolderService()
                .getPermissions(parentFolder);

        if (permission.canAddChildren()) {
            MenuItem mi = menu.add(Menu.NONE, MenuActionItem.MENU_CREATE_FOLDER,
                    Menu.FIRST + MenuActionItem.MENU_CREATE_FOLDER, R.string.folder_create);
            mi.setIcon(R.drawable.ic_add_folder);
            mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
        }
    }

    // Uncomment for enabling view switcher
    /*
     * displayMenuItem = menu.add(Menu.NONE,
     * MenuActionItem.MENU_DISPLAY_ITEMS, Menu.FIRST +
     * MenuActionItem.MENU_DISPLAY_ITEMS, R.string.display_views); switch
     * (displayMode) { case DISPLAY_LIST:
     * displayMenuItem.setIcon(R.drawable.ic_action_list); break; case
     * DISPLAY_LIST_LARGE:
     * displayMenuItem.setIcon(R.drawable.ic_action_tiles_small); break;
     * case DISPLAY_GRID:
     * displayMenuItem.setIcon(R.drawable.ic_action_list_2); break; default:
     * break; }
     * displayMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
     */
}

From source file:org.alfresco.mobile.android.application.extension.samsung.pen.SNoteEditorActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    toolsSubMenu = menu.addSubMenu(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_TOOLS, Menu.FIRST,
            R.string.editor_tools);// w  ww .  j  ava  2  s  .  c o  m
    toolsSubMenu.setIcon(R.drawable.ic_edit);
    toolsSubMenu.getItem().setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);

    // TOOLS MENU
    MenuItem mi = toolsSubMenu.add(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_PEN,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_PEN, R.string.editor_pen);
    mi.setIcon(R.drawable.ic_edit);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

    mi = toolsSubMenu.add(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_TEXT,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_TEXT, R.string.editor_text);
    mi.setIcon(R.drawable.ic_text);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

    mi = toolsSubMenu.add(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_SELECTION,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_SELECTION, R.string.editor_selection);
    mi.setIcon(R.drawable.ic_selection);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

    mi = toolsSubMenu.add(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_ERASER,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_ERASER, R.string.editor_eraser);
    mi.setIcon(R.drawable.ic_eraser);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

    // TOOL SETTINGS MENU
    SubMenu toolsSettingSubMenu = menu.addSubMenu(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_SETTINGS,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_SETTINGS, R.string.editor_tools_settings);
    toolsSettingSubMenu.setIcon(R.drawable.ic_action_settings);
    toolsSettingSubMenu.getItem().setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);

    mi = toolsSettingSubMenu.add(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_SETTINGS_PEN,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_SETTINGS_PEN, R.string.editor_pen);
    mi.setIcon(R.drawable.ic_edit);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

    mi = toolsSettingSubMenu.add(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_SETTINGS_TEXT,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_SETTINGS_TEXT, R.string.editor_text);
    mi.setIcon(R.drawable.ic_text);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

    mi = toolsSettingSubMenu.add(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_SETTINGS_SELECTION,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_SETTINGS_SELECTION, R.string.editor_selection);
    mi.setIcon(R.drawable.ic_selection);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

    mi = toolsSettingSubMenu.add(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_SETTINGS_ERASER,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_SETTINGS_ERASER, R.string.editor_eraser);
    mi.setIcon(R.drawable.ic_eraser);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

    // ADD MENU
    SubMenu addSubMenu = menu.addSubMenu(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_ADD,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_ADD, R.string.editor_add_menu);
    addSubMenu.setIcon(R.drawable.ic_add);
    addSubMenu.getItem().setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);

    // IMAGE
    mi = addSubMenu.add(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_ADD_IMAGE,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_ADD_IMAGE, R.string.editor_add_image);
    mi.setIcon(R.drawable.ic_add_image);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

    // PAGES
    SubMenu pagesMenu = menu.addSubMenu(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_PAGE,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_PAGE, R.string.editor_pages);
    pagesMenu.setIcon(R.drawable.ic_pages);
    pagesMenu.getItem().setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);

    mi = pagesMenu.add(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_PAGE_MOVE,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_PAGE_MOVE, R.string.editor_pages_move);
    mi.setIcon(R.drawable.ic_pages);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

    mi = pagesMenu.add(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_PAGE_ADD,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_PAGE_ADD, R.string.editor_pages_add);
    mi.setIcon(R.drawable.ic_add_page);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

    mi = pagesMenu.add(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_PAGE_DELETE,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_PAGE_DELETE, R.string.editor_pages_remove);
    mi.setIcon(R.drawable.ic_delete);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

    // EXTRA SETTINGS
    // SAVE
    mi = menu.add(Menu.NONE, SNoteMenuActionItem.MENU_EDITOR_SAVE,
            Menu.FIRST + SNoteMenuActionItem.MENU_EDITOR_SAVE, R.string.editor_save);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);

    super.onCreateOptionsMenu(menu);

    return true;
}