@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); // book이 지정되어있지 않으면 신규 추가는 불가능 하도록 한다. if (mBook >= 0) { menu.add(0, MENU_ITEM_ADDNOTE, 0, R.string.menu_addnote) .setIcon(android.R.drawable.ic_menu_add); } menu.add(0, MENU_ITEM_ALLLIST, 0, R.string.menu_allnote) .setIcon(android.R.drawable.ic_menu_agenda); menu.add(0, MENU_ITEM_BOOKLIST, 0, R.string.menu_booksnote) .setIcon(android.R.drawable.ic_menu_agenda); menu.add(0, MENU_ITEM_DAYSLIST, 0, R.string.menu_daysnote) .setIcon(android.R.drawable.ic_menu_agenda); MenuItem item1 = menu.add(0, MENU_ITEM_BIBLEVIEW, 0, R.string.menu_bibleview); item1.setIntent(new Intent(getBaseContext(), BibleViewer.class)); item1.setIcon(R.drawable.app_notes); /* MenuItem item2 = menu.add(0, MENU_ITEM_EDITNOTE, 0, R.string.menu_editnote); item2.setIntent(new Intent(getBaseContext(), NoteEditor.class)); item2.setIcon(android.R.drawable.ic_menu_edit); MenuItem item3 = menu.add(0, MENU_ITEM_DELNOTE, 0, R.string.menu_deletenote); item3.setIntent(new Intent(getBaseContext(), NoteEditor.class)); item3.setIcon(android.R.drawable.ic_menu_delete); */ return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.stats_activity_actionbar_menu, menu); return true; }
public boolean onCreateOptionsMenu(Menu menu) { // 创建菜单 super.onCreateOptionsMenu(menu); // 通过MenuInflater将XML 实例化为 Menu Object MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; }
@Override public boolean onCreateOptionsMenu(android.view.Menu menu) { super.onCreateOptionsMenu(menu); try { if (processBA.subExists("activity_actionbarhomeclick")) { Class.forName("android.app.ActionBar") .getMethod("setHomeButtonEnabled", boolean.class) .invoke(getClass().getMethod("getActionBar").invoke(this), true); } } catch (Exception e) { e.printStackTrace(); } if (menuItems == null) return false; for (B4AMenuItem bmi : menuItems) { android.view.MenuItem mi = menu.add(bmi.title); if (bmi.drawable != null) mi.setIcon(bmi.drawable); if (android.os.Build.VERSION.SDK_INT >= 11) { try { if (bmi.addToBar) { android.view.MenuItem.class.getMethod("setShowAsAction", int.class).invoke(mi, 1); } } catch (Exception e) { e.printStackTrace(); } } mi.setOnMenuItemClickListener( new B4AMenuItemsClickListener(bmi.eventName.toLowerCase(BA.cul))); } return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); // SubMenu submenu = // menu.addSubMenu(R.string.write_label_insert_picture); // submenu.setIcon(android.R.drawable.ic_menu_gallery); // // submenu.add(0, OPTIONS_MENU_ID_IMAGE_CAPTURE, 0, // R.string.write_label_take_a_picture); // submenu.add(0, OPTIONS_MENU_ID_PHOTO_LIBRARY, 0, // R.string.write_label_choose_a_picture); // // MenuItem item = menu.add(0, OPTIONS_MENU_ID_SEARCH, 0, // R.string.omenu_search); // item.setIcon(android.R.drawable.ic_search_category_default); // item.setAlphabeticShortcut(SearchManager.MENU_KEY); MenuItem item; item = menu.add(0, OPTIONS_MENU_ID_PREFERENCES, 0, R.string.omenu_settings); item.setIcon(android.R.drawable.ic_menu_preferences); item = menu.add(0, OPTIONS_MENU_ID_LOGOUT, 0, R.string.omenu_signout); item.setIcon(android.R.drawable.ic_menu_revert); item = menu.add(0, OPTIONS_MENU_ID_ABOUT, 0, R.string.omenu_about); item.setIcon(android.R.drawable.ic_menu_info_details); item = menu.add(0, OPTIONS_MENU_ID_EXIT, 0, R.string.omenu_exit); item.setIcon(android.R.drawable.ic_menu_close_clear_cancel); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(0, 0, 0, "Help").setIcon(android.R.drawable.ic_menu_help); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(0, Menu.FIRST, 0, "保存"); // menu.add(0, Menu.FIRST, 0, R.string.menu_share).setIcon(android.R.drawable.ic_menu_share); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); getMenuInflater().inflate(R.menu.note_folder_menu, menu); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); this.menu = menu; addRegularMenuItems(menu); return true; }
// Create menu @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(0, MENU_EMAIL, 0, "About us"); return true; }
/** * Invoked during init to give the Activity a chance to set up its Menu. * * @param menu the Menu to which entries may be added * @return true */ @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(0, MENU_SIMPLE_UI, 0, R.string.menu_simple_ui); menu.add(0, MENU_WHEEL_OF_LIFE, 0, R.string.menu_wheel_of_life); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuInflater blowUp = getMenuInflater(); blowUp.inflate(R.menu.cool_menu, menu); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. super.onCreateOptionsMenu(menu); menu.add(Menu.NONE, Menu.FIRST + 1, 0, "官网"); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(Menu.NONE, CHOICES_MENU_ID, Menu.NONE, R.string.choices); menu.add(Menu.NONE, REGIONS_MENU_ID, Menu.NONE, R.string.regions); return true; }
/** ********************************************** */ @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.initmenu, menu); return true; }
public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.options_menu, menu); output.append("menu pressed"); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(Menu.NONE, MENU_CONFIGURE_ID, Menu.NONE, R.string.status_configure_menu) .setShortcut('0', 'c'); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); // Log.i("code_log","onCreateOptionsMenu"); menu.add(0, 0, 0, "設定").setIcon(android.R.drawable.ic_menu_preferences); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); if (mDataLoaded) { getMenuInflater().inflate(R.menu.print_custom_content, menu); } return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuItem preferenceItem = menu.add(0, PREFERENCE_ITEM, Menu.NONE, R.string.preferencebutton); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(0, MENU_CONFIRM, 0, R.string.save); menu.getItem(0) .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); Log.d(TAG, "open Menu"); menu.add(0, MENU_ABOUT, 0, R.string.about_label); menu.add(0, MENU_US, 0, R.string.us_label); return true; }
// 菜单 @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); // 添加菜单项 menu.add(0, MENU_SAVE, 0, R.string.menu_save); menu.add(0, MENU_ABOUT, 1, R.string.menu_about); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(0, CLEAR_MENU_ID, 0, "Clear").setShortcut('2', 'x'); menu.add(0, SETTINGS_MENU_ID, 0, "Settings").setShortcut('5', 'z'); return true; }
@Override public boolean onCreateOptionsMenu(android.view.Menu menu) { // TODO Auto-generated method stub super.onCreateOptionsMenu(menu); MenuInflater blowUp = getMenuInflater(); blowUp.inflate(R.menu.aufgabe, menu); return true; }
/** Called to create the menu from your menu.xml file. */ @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); // Inflate the layout from menu.xml MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. super.onCreateOptionsMenu(menu); CrearMenu(menu); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(Menu.NONE, DELETE, Menu.NONE, "Delete All"); menu.add(Menu.NONE, SORT, Menu.NONE, "Sort"); menu.add(Menu.NONE, HELP, Menu.NONE, "Help?"); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { // TODO Auto-generated method stub super.onCreateOptionsMenu(menu); MenuInflater menuInflater = getMenuInflater(); menuInflater.inflate(R.menu.common_menu, menu); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(0, PLAY_ID, 0, R.string.play); menu.add(0, EXIT_ID, 1, R.string.exit); return true; }