示例#1
0
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);

    // Inflate the menu; this adds items to the action bar if it is present.
    inflater.inflate(R.menu.main, menu);
  }
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {

    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.start, menu);

    mMenu = menu;
  };
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   MenuItem searchItem = menu.findItem(R.id.action_search);
   SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
   searchView.setOnQueryTextListener(this);
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   inflater.inflate(R.menu.fragment_crime_list, menu);
   MenuItem showSubtitle = menu.findItem(R.id.menu_item_show_subtitle);
   if (mSubtitleVisible && showSubtitle != null) {
     showSubtitle.setTitle(R.string.hide_subtitle);
   }
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   inflater.inflate(R.menu.list_memory_fragment, menu);
   MenuItem showSubtitle = menu.findItem(R.id.menu_item_show_subtitle);
   if (subtitleVisability && showSubtitle != null) {
     showSubtitle.setTitle(R.string.hide_subtitle);
   }
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   MenuItem accept =
       menu.add(Menu.NONE, MENU_ACCEPT, Menu.NONE, R.string.folder_picker_select_this)
           .setIcon(R.drawable.ic_navigation_accept);
   MenuItemCompat.setShowAsAction(accept, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
   menu.add(Menu.NONE, MENU_SHOW_HIDDEN, Menu.NONE, R.string.folder_picker_show_hidden)
       .setCheckable(true);
   menu.add(Menu.NONE, MENU_SHOW_FILES, Menu.NONE, R.string.folder_picker_show_files)
       .setCheckable(true);
   menu.add(Menu.NONE, MENU_GO_DEFAULT, Menu.NONE, R.string.folder_picker_go_to_default);
   super.onCreateOptionsMenu(menu, inflater);
 }
示例#7
0
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   inflater.inflate(R.menu.fragment_brygd_list, menu);
   Log.d(TAG, "onCreateOptionsMenu");
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   inflater.inflate(R.menu.seasons_menu, menu);
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   inflater.inflate(R.menu.fragment_crime_list, menu);
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   optionsMenu = menu;
   inflater.inflate(R.menu.list, menu);
   super.onCreateOptionsMenu(menu, inflater);
 }
示例#11
0
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   menu.add(0, Constants.MENU_ADD_SOURCE_ID, 0, R.string.add_source)
       .setIcon(android.R.drawable.ic_menu_add);
   super.onCreateOptionsMenu(menu, inflater);
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
 }
  // Menu stuff
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    menu.add(R.string.add_account)
        .setIcon(android.R.drawable.ic_menu_add)
        .setOnMenuItemClickListener(
            new MenuItem.OnMenuItemClickListener() {
              @Override
              public boolean onMenuItemClick(MenuItem item) {
                startActivityForResult(
                    new Intent(getActivity(), WizardChooser.class), CHOOSE_WIZARD);
                return true;
              }
            })
        .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);

    menu.add(R.string.reorder)
        .setIcon(android.R.drawable.ic_menu_sort_by_size)
        .setOnMenuItemClickListener(
            new MenuItem.OnMenuItemClickListener() {
              @Override
              public boolean onMenuItemClick(MenuItem item) {
                AccountsEditListAdapter ad = (AccountsEditListAdapter) getListAdapter();
                ad.toggleDraggable();
                return true;
              }
            })
        .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);

    menu.add(R.string.backup_restore)
        .setIcon(android.R.drawable.ic_menu_save)
        .setOnMenuItemClickListener(
            new MenuItem.OnMenuItemClickListener() {
              @Override
              public boolean onMenuItemClick(MenuItem item) {

                // Populate choice list
                List<String> items = new ArrayList<String>();
                items.add(getResources().getString(R.string.backup));
                final File backupDir = PreferencesWrapper.getConfigFolder(getActivity());
                if (backupDir != null) {
                  String[] filesNames = backupDir.list();
                  for (String fileName : filesNames) {
                    items.add(fileName);
                  }
                }

                final String[] fItems = (String[]) items.toArray(new String[0]);
                AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
                builder.setTitle(R.string.backup_restore);
                builder.setItems(
                    fItems,
                    new DialogInterface.OnClickListener() {
                      public void onClick(DialogInterface dialog, int item) {
                        if (item == 0) {
                          SipProfileJson.saveSipConfiguration(getActivity());
                        } else {
                          File fileToRestore = new File(backupDir + File.separator + fItems[item]);
                          SipProfileJson.restoreSipConfiguration(getActivity(), fileToRestore);
                        }
                      }
                    });
                builder.setCancelable(true);
                AlertDialog backupDialog = builder.create();
                backupDialog.show();
                return true;
              }
            });

    super.onCreateOptionsMenu(menu, inflater);
  }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   // FIXME: CookingSessionList needs a costum menu
 }
示例#15
0
 /* (non-Javadoc)
  * @see android.support.v4.app.Fragment#onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater)
  */
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   inflater.inflate(R.menu.fragment_sync_provider, menu);
   super.onCreateOptionsMenu(menu, inflater);
 }
示例#16
0
 /** This method modifies the options in the bar menu adapting it to this fragment. */
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   menu.clear();
   inflater.inflate(R.menu.add, menu);
 }