android.view.MenuItem.setAlphabeticShortcut()方法的使用及代码示例

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

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

暂无

代码示例

代码示例来源:origin: robolectric/robolectric

item = item.setActionView(null);
assertThat(item).isNotNull();
item = item.setAlphabeticShortcut('a');
assertThat(item).isNotNull();
item = item.setCheckable(false);

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

@Override
public MenuItem setAlphabeticShortcut(char alphaChar) {
  mNativeItem.setAlphabeticShortcut(alphaChar);
  return this;
}

代码示例来源:origin: com.willowtreeapps/oak-demos

@Override
public MenuItem setAlphabeticShortcut(char alphaChar) {
  mNativeItem.setAlphabeticShortcut(alphaChar);
  return this;
}

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

@Override
 public boolean onCreateOptionsMenu(Menu menu) {
   MenuItem mnuHome =menu.add(0, 0, 0, "Home");
   mnuHome.setAlphabeticShortcut('h');
   mnuHome.setIcon(R.drawable.home_icon);
  return super.onCreateOptionsMenu(menu);
 }
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   if(item.getTitle() == "Home") {
     Intent i = new Intent(Budgeter.this, Outgoings.class);
           startActivity(i);
     finish();
   }
 }

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

@Override
public boolean onCreateOptionsMenu(Menu menu){
  super.onCreateOptionsMenu(menu);
  createMenu(menu);
  return true;
}

private void createMenu(Menu menu){
  MenuItem mnu1 = menu.add(0, 0, 0, "Logout");
  {
    mnu1.setAlphabeticShortcut('a');
    mnu1.setIcon(R.drawable.icon);
    mnu1.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
  }
}

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

mnu1.setAlphabeticShortcut('a');
mnu1.setIcon(R.drawable.ic_launcher);
mnu2.setAlphabeticShortcut('b');
mnu2.setIcon(R.drawable.ic_launcher);
mnu3.setAlphabeticShortcut('c');
mnu3.setIcon(R.drawable.ic_launcher);
mnu4.setAlphabeticShortcut('d');

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

mnu1.setAlphabeticShortcut('a');
mnu1.setIcon(android.R.drawable.ic_menu_add);
mnu2.setAlphabeticShortcut('b');
mnu2.setIcon(android.R.drawable.ic_menu_edit);
mnu3.setAlphabeticShortcut('c');
mnu3.setIcon(android.R.drawable.ic_menu_delete);

代码示例来源:origin: geniusgithub/AndroidDialer

@Override
protected void onCreateContextMenu(ContextMenu menu) {
  super.onCreateContextMenu(menu);
  MenuHandler handler = new MenuHandler();
  if (STR_HORIZONTALLINE != null) {
    menu.add(0, ID_HORIZONTALLINE, 0, STR_HORIZONTALLINE).setOnMenuItemClickListener(
        handler);
  }
  if (isStyledText() && STR_CLEARSTYLES != null) {
    menu.add(0, ID_CLEARSTYLES, 0, STR_CLEARSTYLES)
        .setOnMenuItemClickListener(handler);
  }
  if (mManager.canPaste()) {
    menu.add(0, ID_PASTE, 0, STR_PASTE)
        .setOnMenuItemClickListener(handler).setAlphabeticShortcut('v');
  }
}

代码示例来源:origin: THEONE10211024/ApiDemos

item.setAlphabeticShortcut(SearchManager.MENU_KEY);
break;

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

nativeSubItem.setIntent(subItem.getIntent());
    nativeSubItem.setNumericShortcut(subItem.getNumericShortcut());
    nativeSubItem.setAlphabeticShortcut(subItem.getAlphabeticShortcut());
    nativeSubItem.setTitleCondensed(subItem.getTitleCondensed());
    nativeSubItem.setCheckable(subItem.isCheckable());
nativeItem.setIntent(nonActionItem.getIntent());
nativeItem.setNumericShortcut(nonActionItem.getNumericShortcut());
nativeItem.setAlphabeticShortcut(nonActionItem.getAlphabeticShortcut());
nativeItem.setTitleCondensed(nonActionItem.getTitleCondensed());
nativeItem.setCheckable(nonActionItem.isCheckable());

代码示例来源:origin: com.willowtreeapps/oak-demos

nativeSubItem.setIntent(subItem.getIntent());
    nativeSubItem.setNumericShortcut(subItem.getNumericShortcut());
    nativeSubItem.setAlphabeticShortcut(subItem.getAlphabeticShortcut());
    nativeSubItem.setTitleCondensed(subItem.getTitleCondensed());
    nativeSubItem.setCheckable(subItem.isCheckable());
nativeItem.setIntent(nonActionItem.getIntent());
nativeItem.setNumericShortcut(nonActionItem.getNumericShortcut());
nativeItem.setAlphabeticShortcut(nonActionItem.getAlphabeticShortcut());
nativeItem.setTitleCondensed(nonActionItem.getTitleCondensed());
nativeItem.setCheckable(nonActionItem.isCheckable());

相关文章