android.view.Menu.removeItem()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(176)

本文整理了Java中android.view.Menu.removeItem()方法的一些代码示例,展示了Menu.removeItem()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Menu.removeItem()方法的具体详情如下:
包路径:android.view.Menu
类名称:Menu
方法名:removeItem

暂无

代码示例

代码示例来源:origin: stackoverflow.com

public boolean onPrepareOptionsMenu(Menu menu) {

  menu.removeItem(R.id.item1);

  return true;
}

代码示例来源:origin: PhilJay/MPAndroidChart

@Override
public boolean onCreateOptionsMenu(Menu menu) {
  getMenuInflater().inflate(R.menu.bar, menu);
  menu.removeItem(R.id.actionToggleIcons);
  return true;
}

代码示例来源:origin: PhilJay/MPAndroidChart

@Override
public boolean onCreateOptionsMenu(Menu menu) {
  getMenuInflater().inflate(R.menu.line, menu);
  menu.removeItem(R.id.actionToggleIcons);
  return true;
}

代码示例来源:origin: pockethub/PocketHub

@Override
public void onPrepareOptionsMenu(Menu menu) {
  boolean owner = isOwner();
  if (!owner) {
    menu.removeItem(R.id.m_delete);
    MenuItem starItem = menu.findItem(R.id.m_star);
    starItem.setEnabled(loadFinished && !owner);
    if (starred) {
      starItem.setTitle(R.string.unstar);
    } else {
      starItem.setTitle(R.string.star);
    }
  } else {
    menu.removeItem(R.id.m_star);
  }
}

代码示例来源:origin: wangdan/AisenWeiBo

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
  super.onCreateOptionsMenu(menu, inflater);
  inflater.inflate(R.menu.menu_cmts, menu);
  menu.removeItem(R.id.fav);
  menu.removeItem(R.id.repost);
  menu.removeItem(R.id.comment);
  if (mStatusContent.getUser() == null ||
      !mStatusContent.getUser().getIdstr().equalsIgnoreCase(AppContext.getAccount().getUser().getIdstr()))
    menu.removeItem(R.id.delete);
  AisenUtils.setStatusShareMenu(menu.findItem(R.id.share), mStatusContent);
}

代码示例来源:origin: ArthurHub/Android-Image-Cropper

menu.removeItem(R.id.crop_image_menu_rotate_left);
 menu.removeItem(R.id.crop_image_menu_rotate_right);
} else if (mOptions.allowCounterRotation) {
 menu.findItem(R.id.crop_image_menu_rotate_left).setVisible(true);
 menu.removeItem(R.id.crop_image_menu_flip);

代码示例来源:origin: naman14/Timber

navigationView.getMenu().removeItem(R.id.nav_donate);

代码示例来源:origin: naman14/Timber

@Override
public boolean onCreateOptionsMenu(Menu menu) {
  getMenuInflater().inflate(R.menu.menu_main, menu);
  getMenuInflater().inflate(R.menu.menu_cast, menu);
  if (playServicesAvailable) {
    CastButtonFactory.setUpMediaRouteButton(getApplicationContext(),
        menu,
        R.id.media_route_menu_item);
  }
  if (!TimberUtils.hasEffectsPanel(BaseActivity.this)) {
    menu.removeItem(R.id.action_equalizer);
  }
  ATE.applyMenu(this, getATEKey(), menu);
  return true;
}

代码示例来源:origin: stackoverflow.com

@Override
public boolean onPrepareOptionsMenu(Menu menu) {
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    menu.removeItem(R.id.action_overflow);
  }
  return super.onPrepareOptionsMenu(menu);
}

代码示例来源:origin: stackoverflow.com

public boolean onPrepareOptionsMenu(Menu menu) {
  if(!mNavigationDrawerFragment.isDrawerOpen() && (detailFragment!=null && detailFragment.isVisible())) {
      setActionBarTitleView();

  }
  else if(!mNavigationDrawerFragment.isDrawerOpen())
  {

      menu.removeItem(R.id.action_share);
  }
 return  super.onPrepareOptionsMenu(menu);
}

代码示例来源:origin: AppLozic/Applozic-Android-SDK

public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
  super.onCreateOptionsMenu(menu, inflater);
  menu.findItem(R.id.dial).setVisible(false);
  menu.removeItem(R.id.start_new);
  menu.removeItem(R.id.conversations);
  menu.removeItem(R.id.deleteConversation);
  menu.removeItem(R.id.refresh);
}

代码示例来源:origin: com.actionbarsherlock/actionbarsherlock

@Override
public void removeItem(int id) {
  mNativeMap.remove(mNativeMenu.findItem(id));
  mNativeMenu.removeItem(id);
}

代码示例来源:origin: AppLozic/Applozic-Android-SDK

@Override
public boolean onCreateOptionsMenu(Menu menu) {
  getMenuInflater().inflate(R.menu.group_create_menu, menu);
  menu.removeItem(R.id.Done);
  menu.findItem(R.id.menu_search).setVisible(false);
  return true;
}

代码示例来源:origin: iQueSoft/iQuePhoto

@Override
public void onPrepareOptionsMenu(Menu menu) {
  menu.removeItem(R.id.action_share);
  super.onPrepareOptionsMenu(menu);
}

代码示例来源:origin: nvllsvm/Audinaut

@Override
  public void onCreateActionModeMenu(Menu menu, MenuInflater menuInflater) {
    if (Util.isOffline(context)) {
      menuInflater.inflate(R.menu.multiselect_media_offline, menu);
    } else {
      menuInflater.inflate(R.menu.multiselect_media, menu);
    }

    menu.removeItem(R.id.menu_remove_playlist);
  }
}

代码示例来源:origin: nshmura/strictmode-notifier

@Override public boolean onCreateOptionsMenu(Menu menu) {
 MenuInflater inflater = getMenuInflater();
 inflater.inflate(R.menu.strictmode_notifier_menu, menu);
 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
  menu.removeItem(R.id.__menu_copy);
 }
 return true;
}

代码示例来源:origin: SMSTicket/sms-ticket

@Override
public boolean onCreateOptionsMenu(Menu menu) {
  MenuInflater inflater = getMenuInflater();
  inflater.inflate(R.menu.main, menu);
  if (App.isReleaseBuild()) {
    menu.removeItem(R.id.menu_add_testing_ticket);
  }
  return super.onCreateOptionsMenu(menu);
}

代码示例来源:origin: nvllsvm/Audinaut

@Override
public void onCreateContextMenu(Menu menu, MenuInflater menuInflater, UpdateView<Serializable> updateView, Serializable item) {
  onCreateContextMenuSupport(menu, menuInflater, updateView, item);
  if (item instanceof MusicDirectory.Entry && !Util.isOffline(context)) {
    menu.removeItem(R.id.song_menu_remove_playlist);
  }
  recreateContextMenu(menu);
}

代码示例来源:origin: nvllsvm/Audinaut

@Override
public void onCreateContextMenu(Menu menu, MenuInflater menuInflater, UpdateView<DownloadFile> updateView, DownloadFile downloadFile) {
  MusicDirectory.Entry selectedItem = downloadFile.getSong();
  onCreateContextMenuSupport(menu, menuInflater, updateView, selectedItem);
  if (!Util.isOffline(context)) {
    menu.removeItem(R.id.song_menu_remove_playlist);
  }
  recreateContextMenu(menu);
}

代码示例来源:origin: owntracks/android

private void showPopupMenu(View v) {
  PopupMenu popupMenu = new PopupMenu(this, v, Gravity.START); //new PopupMenu(this, v);
  popupMenu.getMenuInflater().inflate(R.menu.menu_popup_contacts, popupMenu.getMenu());
  popupMenu.setOnMenuItemClickListener(this);
  if (preferences.getModeId() == MessageProcessorEndpointHttp.MODE_ID)
    popupMenu.getMenu().removeItem(R.id.menu_clear);
  popupMenu.show();
}

相关文章