@Override public boolean onCreateOptionsMenu(Menu menu) { if (DeviceConnectionManager.getInstance().isConnected()) { onBlueToothItem = menu.add(0, Menu.FIRST + 1, 1, "连接蓝牙").setIcon(R.drawable.btn_connect_indicator_on); } else { onBlueToothItem = menu.add(0, Menu.FIRST + 1, 1, "").setIcon(R.drawable.btn_connect_indicator_off); } onBlueToothItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); if (isStartGame) { disconnectItem = menu.add(0, Menu.FIRST + 2, 1, "关闭连接").setIcon(R.drawable.stop_multi_game); disconnectItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); } return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { MenuItem refresh = menu.add(0, 1, 1, "Joomla"); refresh.setIcon(R.drawable.ic_action_overflow); refresh.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT); refresh.setOnMenuItemClickListener(this); return true; }
@Override public boolean onCreateOptionsMenu(Menu menu) { MenuItem saveItem = menu.add(0, 10001, 0, "确定"); saveItem.setIcon(android.R.drawable.ic_menu_save); saveItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_WITH_TEXT | MenuItem.SHOW_AS_ACTION_IF_ROOM); return true; }
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); MenuItem create = menu.add("Create"); create.setIcon(R.drawable.ic_menu_add2); create.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); }
// オプションメニューの追加 @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); /* //ツイッターログイン MenuItem tw_login = menu.add(0, tw_login_menu_id, Menu.NONE, getString(R.string.tw_setting)); tw_login.setIcon(android.R.drawable.ic_menu_preferences); tw_login.setShowAsAction(MenuItem.SHOW_AS_ACTION_WITH_TEXT); */ // IPPログイン MenuItem ipp_login = menu.add(0, ipp_login_menu_id, Menu.NONE, getString(R.string.ipp_login)); ipp_login.setIcon(android.R.drawable.ic_menu_preferences); ipp_login.setShowAsAction(MenuItem.SHOW_AS_ACTION_WITH_TEXT); // リロード MenuItem reload = menu.add(0, reload_menu_id, Menu.NONE, getString(R.string.comment_reload)); reload.setIcon(android.R.drawable.ic_menu_preferences); reload.setShowAsAction(MenuItem.SHOW_AS_ACTION_WITH_TEXT); // 追加読み込み MenuItem addget = menu.add(0, addget_menu_id, Menu.NONE, getString(R.string.additionalGet)); addget.setIcon(android.R.drawable.ic_menu_preferences); addget.setShowAsAction(MenuItem.SHOW_AS_ACTION_WITH_TEXT); // ストレス変更 /* MenuItem stress_change = menu.add(0, stress_change_menu_id, Menu.NONE, getString(R.string.stress_change)); stress_change.setIcon(android.R.drawable.ic_menu_preferences); stress_change.setShowAsAction(MenuItem.SHOW_AS_ACTION_WITH_TEXT); */ // 近くに限る nearMenu = menu.add(0, near_menu_id, Menu.NONE, getString(R.string.near)); nearMenu.setIcon(android.R.drawable.ic_menu_compass); // near.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); アクションバー上にアイコンで表示 nearMenu.setShowAsAction(MenuItem.SHOW_AS_ACTION_WITH_TEXT); // ドロップダウンのメニューに表示 }
@Override public boolean onCreateOptionsMenu(Menu menu) { menu.clear(); if (mShowQuitButton) { mMenuItemSettings = menu.add("设置") // .setIcon(R.drawable.logout_icon); .setIcon(R.drawable.settings); mMenuItemSettings.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); } // menu.add("设置").setIcon(R.drawable.setting_icon); return super.onCreateOptionsMenu(menu); }
@Override public boolean onCreateOptionsMenu(Menu menu) { mainMenu = menu; subMenu1 = menu.addSubMenu("Options"); MenuInflater inflater = getSupportMenuInflater(); inflater.inflate(R.menu.main, subMenu1); MenuItem subMenu1Item = subMenu1.getItem(); subMenu1Item.setIcon(R.drawable.abs__ic_menu_moreoverflow_normal_holo_dark); subMenu1Item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); return super.onCreateOptionsMenu(menu); }
@Override public boolean onCreateOptionsMenu(Menu menu) { menu.add("Search") .setIcon(R.drawable.ic_action_search) .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); SubMenu subMenu1 = menu.addSubMenu("Action Item"); subMenu1.add("My Topics"); subMenu1.add("Review"); subMenu1.add("Config"); MenuItem subMenu1Item = subMenu1.getItem(); subMenu1Item.setIcon(R.drawable.ic_action_options); subMenu1Item.setShowAsAction( MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT); return super.onCreateOptionsMenu(menu); }
public boolean onCreateOptionsMenu(Menu menu) { SubMenu my_events_submenu = menu.addSubMenu("New Account"); my_events_submenu.add("DropBox").setIcon(R.drawable.dropbox_icon); my_events_submenu.add("Google Drive").setIcon(R.drawable.google_drive_icon); my_events_submenu.add("One Drive").setIcon(R.drawable.skydrive_icon); my_events_submenu.add("Ftp Account").setIcon(R.drawable.ftp_icon); my_events_submenu.add("WebDav"); MenuItem subMenu1Item = my_events_submenu.getItem(); subMenu1Item.setShowAsAction( MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT); SubMenu my_account_submenu = menu.addSubMenu("Set Password"); my_account_submenu.add("My Profile"); my_account_submenu.add("Settings"); my_account_submenu.add("Log Out"); return true; }
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); menu.add(Menu.NONE, R.id.action_bar_invite, 0, "Search") .setIcon(R.drawable.ic_menu_invite) .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); MenuItem refreshItem = menu.add(Menu.NONE, R.id.action_bar_refresh, 1, "Refresh"); refreshItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); if (refresh) refreshItem.setActionView(flProgress); else refreshItem.setIcon(R.drawable.ic_menu_refresh); if (username != null && u != null && !username.equals(u.getUsername())) { menu.add(Menu.NONE, R.id.action_bar_delete, Menu.NONE, "Delete") .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); } menu.add(Menu.NONE, R.id.action_bar_about, Menu.NONE, "About") .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); }
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { fav = menu.add("add"); fav.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); fav.setOnMenuItemClickListener( new OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { // TODO Auto-generated method stub MovieSearchFragment searchFrag = new MovieSearchFragment(currentUser); getActivity() .getSupportFragmentManager() .beginTransaction() .replace(R.id.fragmentframe, searchFrag, "movie_search") .addToBackStack(getTag()) .commit(); return true; } }); // fav.sho; // fav.setIcon(R.); }