Java Code Examples for android.view.Menu

The following are top voted examples for showing how to use android.view.Menu. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: openlocate-android   File: MainActivity.java   View source code 7 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    if (showReloadPlacesButton) {
        getMenuInflater().inflate(R.menu.main_menu, menu);
        final MenuItem myActionMenuItem = menu.findItem(R.id.action_refresh);
        myActionMenuItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
            @Override
            public boolean onMenuItemClick(MenuItem item) {
                PlaceFragment placeFragment = (PlaceFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_container);
                if (placeFragment.isAdded()) {
                    placeFragment.currentPlace();
                }
                return false;
            }
        });
    }
    return super.onCreateOptionsMenu(menu);
}
 
Example 2
Project: iSPY   File: TrackerActivity.java   View source code 6 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_switch, menu);

    // Get the action view used in your toggleservice item
    final MenuItem toggle = menu.findItem(R.id.menu_switch);
    mSwitch = (SwitchCompat) toggle.getActionView().findViewById(R.id.switchInActionBar);
    mSwitch.setEnabled(mTransportIdEditText.length() > 0 && mEmailEditText.length() > 0 &&
            mPasswordEditText.length() > 0);
    mSwitch.setChecked(mStartButton.getVisibility() != View.VISIBLE);
    mSwitch.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (((SwitchCompat) v).isChecked()) {
                checkInputFields();
            } else {
                confirmStop();
            }
        }
    });
    return super.onCreateOptionsMenu(menu);
}
 
Example 3
Project: MKAPP   File: ActivityMain.java   View source code 6 votes vote down vote up
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);

    if (prefs.getBoolean("manage_system", false)) {
        menu.findItem(R.id.menu_app_user).setChecked(prefs.getBoolean("show_user", true));
        menu.findItem(R.id.menu_app_system).setChecked(prefs.getBoolean("show_system", false));
    } else {
        Menu submenu = menu.findItem(R.id.menu_filter).getSubMenu();
        submenu.removeItem(R.id.menu_app_user);
        submenu.removeItem(R.id.menu_app_system);
    }

    menu.findItem(R.id.menu_app_nointernet).setChecked(prefs.getBoolean("show_nointernet", true));
    menu.findItem(R.id.menu_app_disabled).setChecked(prefs.getBoolean("show_disabled", true));

    String sort = prefs.getString("sort", "name");
    if ("uid".equals(sort))
        menu.findItem(R.id.menu_sort_uid).setChecked(true);
    else
        menu.findItem(R.id.menu_sort_name).setChecked(true);

    menu.findItem(R.id.menu_lockdown).setChecked(prefs.getBoolean("lockdown", false));

    return super.onPrepareOptionsMenu(menu);
}
 
Example 4
Project: Espresso   File: PackagesAdapter.java   View source code 6 votes vote down vote up
/**
 * Create the context menu.
 * @param menu The context menu.
 * @param v The view.
 * @param menuInfo The menu information.
 */
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    if (menu != null) {
        ((MainActivity)context).setSelectedPackageId(list.get(getLayoutPosition()).getNumber());
        Package pack = list.get(getLayoutPosition());
        menu.setHeaderTitle(pack.getName());
        // Set different title according to the data({@link Package#readable})
        if (pack.isReadable()) {
            menu.add(Menu.NONE, R.id.action_set_readable, 0, R.string.set_read);
        } else {
            menu.add(Menu.NONE, R.id.action_set_readable, 0, R.string.set_unread);
        }
        menu.add(Menu.NONE, R.id.action_copy_code, 0, R.string.copy_code);
        menu.add(Menu.NONE, R.id.action_share, 0, R.string.share);
    }
}
 
Example 5
Project: ProgressManager   File: a.java   View source code 6 votes vote down vote up
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onPanelClosed(int, Menu)} for
 * activities. This calls through to {@link #onOptionsMenuClosed(Menu)}
 * method for the {@link android.view.Window#FEATURE_OPTIONS_PANEL} panel,
 * so that subclasses of Activity don't need to deal with feature codes.
 * For context menus ({@link Window#FEATURE_CONTEXT_MENU}), the
 * {@link #onContextMenuClosed(Menu)} will be called.
 */
public void onPanelClosed(int featureId, Menu menu) {
    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            mFragments.dispatchOptionsMenuClosed(menu);
            onOptionsMenuClosed(menu);
            break;

        case Window.FEATURE_CONTEXT_MENU:
            onContextMenuClosed(menu);
            break;

        case Window.FEATURE_ACTION_BAR:
            initWindowDecorActionBar();
            mActionBar.dispatchMenuVisibilityChanged(false);
            break;
    }
}
 
Example 6
Project: OSchina_resources_android   File: QuestionDetailActivity.java   View source code 6 votes vote down vote up
@SuppressLint("SetTextI18n")
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_question_detail, menu);
        MenuItem item = menu.findItem(R.id.menu_comment);
        if (item != null) {
            View action = item.getActionView();
            if (action != null) {
                View tv = action.findViewById(R.id.tv_comment_count);
                if (tv != null) {
                    mCommentCountView = (TextView) tv;
                    if (mBean.getStatistics() != null)
                        mCommentCountView.setText(mBean.getStatistics().getComment() + "");
                }
            }
        }
//        MenuItem menuItem = menu.findItem(R.id.menu_report);
//        DrawableCompat.setTint(menuItem.getIcon(),Color.WHITE);
        return true;
    }
 
Example 7
Project: YZxing   File: ScannerActivity.java   View source code 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    if (isEnableScanFromPicture) {
        getMenuInflater().inflate(R.menu.menu_scan, menu);
        return true;
    } else {
        return super.onCreateOptionsMenu(menu);
    }
}
 
Example 8
Project: navigator   File: MainView.java   View source code 5 votes vote down vote up
public boolean onCreateOptionsMenu(Menu menu) {
    if(root != null && root.getChildAt(0) != null) {
        Key key = backstackHolder.getBackstack().getKey(root.getChildAt(0).getContext());
        MainActivity.get(getContext()).getMenuInflater().inflate(key.menu(), menu);
        return true;
    }
    return false;
}
 
Example 9
Project: SOS-The-Healthcare-Companion   File: BaseFragment.java   View source code 5 votes vote down vote up
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);

    MenuItem item = menu.findItem(R.id.action_search);
    SearchView searchView = (SearchView) MenuItemCompat.getActionView(item);
    searchView.setOnQueryTextListener(this);
}
 
Example 10
Project: Remindy   File: HomeListFragment.java   View source code 5 votes vote down vote up
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
    mode.getMenuInflater().inflate (R.menu.menu_home_contextual, menu);
    menu.findItem(R.id.home_contextual_done).setVisible( (mReminderTypeToDisplay == ViewPagerTaskDisplayType.PROGRAMMED) );
    menu.findItem(R.id.home_contextual_not_done).setVisible( (mReminderTypeToDisplay == ViewPagerTaskDisplayType.DONE) );
    return true;
}
 
Example 11
Project: Nird2   File: ConversationActivity.java   View source code 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
	// Inflate the menu items for use in the action bar
	MenuInflater inflater = getMenuInflater();
	inflater.inflate(R.menu.conversation_actions, menu);

	enableIntroductionActionIfAvailable(
			menu.findItem(R.id.action_introduction));

	return super.onCreateOptionsMenu(menu);
}
 
Example 12
Project: ProgressManager   File: a.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @return The default implementation returns true.
 */
public boolean onMenuOpened(int featureId, Menu menu) {
    if (featureId == Window.FEATURE_ACTION_BAR) {
        initWindowDecorActionBar();
        if (mActionBar != null) {
            mActionBar.dispatchMenuVisibilityChanged(true);
        } else {
            Log.e(TAG, "Tried to open action bar menu with no action bar");
        }
    }
    return true;
}
 
Example 13
Project: rental-calc   File: PictureViewActivity.java   View source code 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
    getMenuInflater().inflate(R.menu.picture_view_menu, menu);

    // Locate MenuItem with ShareActionProvider
    MenuItem item = menu.findItem(R.id.action_share);

    // Fetch ShareActionProvider
    ShareActionProvider shareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(item);
    if (shareActionProvider == null)
    {
        Log.w(TAG, "Failed to find share action provider");
        return false;
    }

    if(imageFilename == null)
    {
        Log.w(TAG, "No receipt to share");
        return false;
    }

    Intent shareIntent = new Intent(Intent.ACTION_SEND);

    // Determine mimetype of image
    BitmapFactory.Options opt = new BitmapFactory.Options();
    opt.inJustDecodeBounds = true;
    BitmapFactory.decodeFile(imageFilename, opt);
    shareIntent.setType(opt.outMimeType);

    shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(imageFilename)));
    shareActionProvider.setShareIntent(shareIntent);

    return super.onCreateOptionsMenu(menu);
}
 
Example 14
Project: LiteReader   File: ZhihuStoryDetailViewModel.java   View source code 5 votes vote down vote up
@Override
public boolean onCreateOptionMenu(Menu menu) {
    this.menu = menu;
    getSelfView().getCompatActivity().getMenuInflater().inflate(R.menu.menu_common, menu);
    initCollect();
    return true;
}
 
Example 15
Project: NanoIconPack   File: AppAdapter.java   View source code 5 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu contextMenu, View view, ContextMenu.ContextMenuInfo contextMenuInfo) {
    contextMenu.setHeaderTitle(dataList.get(contextMenuActiveItemPos).getLabel());
    contextMenu.add(Menu.NONE, 0, Menu.NONE, R.string.menu_request_icon);
    contextMenu.add(Menu.NONE, 1, Menu.NONE, R.string.menu_copy_code);
    contextMenu.add(Menu.NONE, 2, Menu.NONE, R.string.menu_save_icon);
    contextMenu.getItem(0).setOnMenuItemClickListener(this);
    contextMenu.getItem(1).setOnMenuItemClickListener(this);
    contextMenu.getItem(2).setOnMenuItemClickListener(this);

    contextMenu.getItem(0).setVisible(enableStatsModule);
}
 
Example 16
Project: Swift-Braille-Soft-keyboard   File: SettingsActivity.java   View source code 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    try{
        MenuInflater menuInflater = getMenuInflater();
        menuInflater.inflate(R.menu.settings_menu, menu);
    } catch(Exception e){
        e.printStackTrace();
    }

    return super.onCreateOptionsMenu(menu);
}
 
Example 17
Project: AndroidAsyncHTTP   File: SampleParentActivity.java   View source code 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    menu.add(Menu.NONE, MENU_USE_HTTPS, Menu.NONE, R.string.menu_use_https).setCheckable(true);
    menu.add(Menu.NONE, MENU_CLEAR_VIEW, Menu.NONE, R.string.menu_clear_view);
    menu.add(Menu.NONE, MENU_ENABLE_LOGGING, Menu.NONE, "Enable Logging").setCheckable(true);
    menu.add(Menu.NONE, MENU_LOGGING_VERBOSITY, Menu.NONE, "Set Logging Verbosity");
    return super.onCreateOptionsMenu(menu);
}
 
Example 18
Project: BookED   File: ProfileFragment.java   View source code 5 votes vote down vote up
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    inflater.inflate(R.menu.profilemenu,menu);

    MenuItem logout = menu.findItem(R.id.logout);
    super.onCreateOptionsMenu(menu, inflater);
}
 
Example 19
Project: OpenYOLO-Android   File: NeverSaveListActivity.java   View source code 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.menu_main, menu);
    //hide the lock icon in this case
    menu.getItem(1).setVisible(false);
    return true;
}
 
Example 20
Project: SimpleNotes   File: MultiChoiceImplementation.java   View source code 5 votes vote down vote up
@Override
//Здесь надуваем наше меню из xml
public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
    Log.d(TAG, "onCreateActionMode");
    MenuInflater inflater = actionMode.getMenuInflater();
    inflater.inflate(R.menu.action_mode_menu, menu);
    return true;
}
 
Example 21
Project: Rey-MusicPlayer   File: SongsFragment.java   View source code 5 votes vote down vote up
@Override
public void onPrepareOptionsMenu(Menu menu) {
    super.onPrepareOptionsMenu(menu);
    menu.clear();
    getActivity().getMenuInflater().inflate(R.menu.menu_song, menu);

    if (PreferencesHelper.getInstance().getString(PreferencesHelper.Key.SONG_SORT_TYPE, Constants.ASCENDING).equalsIgnoreCase(Constants.ASCENDING)) {
        menu.findItem(R.id.sort_song_type).setChecked(true);
    } else {
        menu.findItem(R.id.sort_song_type).setChecked(false);
    }

    String songSortOrder = PreferencesHelper.getInstance().getString(PreferencesHelper.Key.SONG_SORT_ORDER, SortOrder.SongSortOrder.SONG_DEFAULT);

    if (songSortOrder.equalsIgnoreCase(SortOrder.SongSortOrder.SONG_DEFAULT)) {
        menu.findItem(R.id.sort_song_default).setChecked(true);
    } else if (songSortOrder.equalsIgnoreCase(SortOrder.SongSortOrder.SONG_DISPLAY_NAME)) {
        menu.findItem(R.id.sort_song_name).setChecked(true);
    } else if (songSortOrder.equalsIgnoreCase(SortOrder.SongSortOrder.SONG_TRACK_NO)) {
        menu.findItem(R.id.sort_song_track_no).setChecked(true);
    } else if (songSortOrder.equalsIgnoreCase(SortOrder.SongSortOrder.SONG_DURATION)) {
        menu.findItem(R.id.sort_song_duration).setChecked(true);
    } else if (songSortOrder.equalsIgnoreCase(SortOrder.SongSortOrder.SONG_YEAR)) {
        menu.findItem(R.id.sort_song_year).setChecked(true);
    } else if (songSortOrder.equalsIgnoreCase(SortOrder.SongSortOrder.SONG_DATE)) {
        menu.findItem(R.id.sort_song_date_added).setChecked(true);
    } else if (songSortOrder.equalsIgnoreCase(SortOrder.SongSortOrder.SONG_ALBUM)) {
        menu.findItem(R.id.sort__song_album_name).setChecked(true);
    } else if (songSortOrder.equalsIgnoreCase(SortOrder.SongSortOrder.SONG_ARTIST)) {
        menu.findItem(R.id.sort_song_artist_name).setChecked(true);
    } else if (songSortOrder.equalsIgnoreCase(SortOrder.SongSortOrder.SONG_FILENAME)) {
        menu.findItem(R.id.sort_song_file_name).setChecked(true);
    }

}
 
Example 22
Project: GitHub   File: MediaVariationsFragment.java   View source code 5 votes vote down vote up
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
  inflater.inflate(R.menu.fragment_imagepipeline_media_variations, menu);

  menu.findItem(mMode.menuItemId).setChecked(true);

  super.onCreateOptionsMenu(menu, inflater);
}
 
Example 23
Project: aos-Video   File: BrowserBySeason.java   View source code 5 votes vote down vote up
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {

    super.onCreateOptionsMenu(menu, inflater);
    if (mBrowserAdapter != null
            && !mBrowserAdapter.isEmpty()) {
        mDisplayModeSubmenu.clear();
        mDisplayModeSubmenu.addSubmenuItem(R.drawable.ic_menu_list_mode2, R.string.view_mode_list, 0);
        mDisplayModeSubmenu.addSubmenuItem(R.drawable.ic_menu_grid_mode, R.string.view_mode_grid, 0);
        mDisplayModeSubmenu.selectSubmenuItem(mViewMode == VideoUtils.VIEW_MODE_GRID
                ? SUBMENU_ITEM_GRID_INDEX : SUBMENU_ITEM_LIST_INDEX);
    }

}
 
Example 24
Project: AndroidAsyncHTTP   File: SampleParentActivity.java   View source code 5 votes vote down vote up
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
    MenuItem useHttpsMenuItem = menu.findItem(MENU_USE_HTTPS);
    if (useHttpsMenuItem != null) {
        useHttpsMenuItem.setChecked(useHttps);
    }
    MenuItem enableLoggingMenuItem = menu.findItem(MENU_ENABLE_LOGGING);
    if (enableLoggingMenuItem != null) {
        enableLoggingMenuItem.setChecked(enableLogging);
    }
    return super.onPrepareOptionsMenu(menu);
}
 
Example 25
Project: chat-sdk-android-push-firebase   File: ChatSDKAbstractChatActivity.java   View source code 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {

    if (!inflateMenuItems)
        return super.onCreateOptionsMenu(menu);

    // Adding the add user option only if group chat is enabled.
    if (BDefines.Options.GroupEnabled)
    {
        MenuItem item =
                menu.add(Menu.NONE, R.id.action_chat_sdk_add, 10, getString(R.string.chat_activity_show_users_item_text));
        item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
        item.setIcon(R.drawable.ic_plus);
    }

    if (BDefines.Options.ThreadDetailsEnabled)
    {

        MenuItem itemThreadUsers =
            menu.add(Menu.NONE, R.id.action_chat_sdk_thread_details, 10, getString(R.string.chat_activity_show_thread_details));
        
        itemThreadUsers.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
        itemThreadUsers.setIcon(android.R.drawable.ic_menu_info_details);
    }
    
    return super.onCreateOptionsMenu(menu);
}
 
Example 26
Project: ImageClassify   File: TopBarBaseActivity.java   View source code 5 votes vote down vote up
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
    if (!TextUtils.isEmpty(menuStr)){
        menu.findItem(R.id.menu_1).setTitle(menuStr);
    }
    return super.onPrepareOptionsMenu(menu);
}
 
Example 27
Project: DinningShare   File: CordovaActivity.java   View source code 5 votes vote down vote up
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
    if (appView != null) {
        appView.getPluginManager().postMessage("onPrepareOptionsMenu", menu);
    }
    return true;
}
 
Example 28
Project: zabbkit-android   File: GraphFragment.java   View source code 5 votes vote down vote up
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    MenuItem shareMenuItem = menu.add(0, ID_MENU_SHARE, 0, R.string.menu_share).setIcon(R.drawable.ic_menu_share);
    MenuItem saveMenuItem = menu.add(0, ID_MENU_SAVE, 0, R.string.menu_save).setIcon(android.R.drawable.ic_menu_save);
    MenuItem bookmarkMenuItem = menu.add(0, ID_MENU_BOOKMARK, 0, R.string.menu_bookmark).setIcon(android.R.drawable.star_big_off);
    MenuItemCompat.setShowAsAction(shareMenuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
    MenuItemCompat.setShowAsAction(saveMenuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
    MenuItemCompat.setShowAsAction(bookmarkMenuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
    super.onCreateOptionsMenu(menu, inflater);
}
 
Example 29
Project: q-mail   File: ChooseFolder.java   View source code 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    getMenuInflater().inflate(R.menu.folder_select_option, menu);
    configureFolderSearchView(menu);
    return true;
}
 
Example 30
Project: GitHub   File: ConsoleActivity.java   View source code 5 votes vote down vote up
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
	super.onPrepareOptionsMenu(menu);

	setVolumeControlStream(AudioManager.STREAM_NOTIFICATION);

	final TerminalView view = adapter.getCurrentTerminalView();
	boolean activeTerminal = view != null;
	boolean sessionOpen = false;
	boolean disconnected = false;
	boolean canForwardPorts = false;

	if (activeTerminal) {
		TerminalBridge bridge = view.bridge;
		sessionOpen = bridge.isSessionOpen();
		disconnected = bridge.isDisconnected();
		canForwardPorts = bridge.canFowardPorts();
	}

	disconnect.setEnabled(activeTerminal);
	if (sessionOpen || !disconnected)
		disconnect.setTitle(R.string.list_host_disconnect);
	else
		disconnect.setTitle(R.string.console_menu_close);

	if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
		copy.setEnabled(activeTerminal);
	}
	paste.setEnabled(activeTerminal);
	portForward.setEnabled(sessionOpen && canForwardPorts);
	urlscan.setEnabled(activeTerminal);
	resize.setEnabled(sessionOpen);

	return true;
}
 
Example 31
Project: Treebolic   File: ProvidersActivity.java   View source code 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(final Menu menu)
{
	// inflate the menu; this adds items to the action bar if it is present.
	getMenuInflater().inflate(R.menu.providers, menu);
	return true;
}
 
Example 32
Project: q-mail   File: MessageList.java   View source code 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.message_list_option, menu);
    mMenu = menu;
    mMenuButtonCheckMail= menu.findItem(R.id.check_mail);
    return true;
}
 
Example 33
Project: buildAPKsSamples   File: FoldingLayoutActivity.java   View source code 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    if (IS_JBMR2) {
        getMenuInflater().inflate(R.menu.fold_with_bug, menu);
    } else {
        getMenuInflater().inflate(R.menu.fold, menu);
    }
    Spinner s = (Spinner) menu.findItem(R.id.num_of_folds).getActionView();
    s.setOnItemSelectedListener(mItemSelectedListener);
    return true;
}
 
Example 34
Project: Library-System-Android   File: CreateClass.java   View source code 4 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_main, menu);
    return true;
}
 
Example 35
Project: RetroMusicPlayer   File: FoldersFragment.java   View source code 4 votes vote down vote up
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.menu_folders, menu);
    ToolbarContentTintHelper.handleOnCreateOptionsMenu(getActivity(), toolbar, menu, ATHToolbarActivity.getToolbarBackgroundColor(toolbar));
}
 
Example 36
Project: nucleus-test   File: FormularioActivity.java   View source code 4 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.menu_lista_cliente, menu);
    return super.onCreateOptionsMenu(menu);
}
 
Example 37
Project: zabbkit-android   File: OverviewFragment.java   View source code 4 votes vote down vote up
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    MenuItem item = menu.add(0, MENU_SETTING, 100, R.string.action_settings).setIcon(R.drawable.ic_menu_servers);
    MenuItemCompat.setShowAsAction(item, 2);
    super.onCreateOptionsMenu(menu, inflater);
}
 
Example 38
Project: boohee_v5.6   File: SpecialLessonDetailActivity.java   View source code 4 votes vote down vote up
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.q, menu);
    this.menu = menu;
    return true;
}
 
Example 39
Project: School1-Android   File: ConfigCourseActivity.java   View source code 4 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.config_course, menu);
    return true;
}
 
Example 40
Project: AwesomeImagePicker   File: MainActivity.java   View source code 4 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
}