@Override
  public void onPrepareOptionsMenu(Menu menu) {
    // TODO Auto-generated method stub
    menu.removeItem(2);

    super.onPrepareOptionsMenu(menu);
  }
Пример #2
0
  @Override
  public boolean onPrepareOptionsMenu(Menu menu) {
    menu.clear();
    MenuInflater inflater = getSupportMenuInflater();
    inflater.inflate(R.menu.repo_menu, menu);

    if (Gh4Application.THEME != R.style.LightTheme) {
      menu.getItem(0).setIcon(R.drawable.navigation_refresh_dark);
    }

    MenuItem watchAction = menu.getItem(1);
    if (isAuthorized()) {
      if (!isFinishLoadingWatching) {
        watchAction.setActionView(R.layout.ab_loading);
        watchAction.expandActionView();
      } else {
        if (isWatching) {
          watchAction.setTitle(R.string.repo_unwatch_action);
        } else {
          watchAction.setTitle(R.string.repo_watch_action);
        }
      }
    } else {
      menu.removeItem(R.id.watch);
    }

    return super.onPrepareOptionsMenu(menu);
  }
  @Override
  public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
    inflater.inflate(R.menu.request_coins_fragment_options, menu);

    if (!checkForLocalApp()) menu.removeItem(2); // The "Request from local" menu entry.

    super.onCreateOptionsMenu(menu, inflater);
  }
  @Override
  public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
    inflater.inflate(R.menu.request_coins_fragment_options, menu);

    final MenuItem shareItem = menu.findItem(R.id.request_coins_options_share);
    shareActionProvider = (ShareActionProvider) shareItem.getActionProvider();

    updateShareIntent();

    if (!checkForLocalApp()) menu.removeItem(2); // The "Request from local" menu entry.

    super.onCreateOptionsMenu(menu, inflater);
  }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   inflater.inflate(R.menu.ab_list_fragment, menu);
   if (getArguments().containsKey(Extra.DISABLE_SEARCH)) menu.removeItem(R.id.menu_search);
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   this.mMenu = menu;
   menu.removeItem(R.id.map_all_classes);
   inflater.inflate(R.menu.schedule_menu, menu);
 }