Example #1
0
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);

    getMenuInflater().inflate(R.menu.broadcast, menu);
    return true;
  }
Example #2
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   super.onCreateOptionsMenu(menu);
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.menu_login, menu);
   return true;
 }
Example #3
0
 public boolean onCreateOptionsMenu(Menu menu) {
   // Inflate the menu; this adds items to the action bar if it is present.
   // getMenuInflater().inflate(R.menu.menu_main, menu);
   super.onCreateOptionsMenu(menu);
   CreateMenu(menu);
   return true;
 }
  public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    this.menu = menu;
    MenuInflater inflater = getMenuInflater();
    if (mode != PRESENT_VIDEOS_MODE && findViewById(R.id.videoitem_detail_container) == null) {
      inflater.inflate(R.menu.videoitem_list, menu);
      MenuItem searchItem = menu.findItem(R.id.action_search);
      SearchView searchView = (SearchView) searchItem.getActionView();
      searchView.setFocusable(false);
      searchView.setOnQueryTextListener(new SearchVideoQueryListener());
      suggestionListAdapter = new SuggestionListAdapter(this);
      searchView.setSuggestionsAdapter(suggestionListAdapter);
      searchView.setOnSuggestionListener(new SearchSuggestionListener(searchView));
      if (!searchQuery.isEmpty()) {
        searchView.setQuery(searchQuery, false);
        searchView.setIconifiedByDefault(false);
      }
    } else if (videoFragment != null) {
      videoFragment.onCreateOptionsMenu(menu, inflater);
    } else {
      inflater.inflate(R.menu.videoitem_two_pannel, menu);
    }

    return true;
  }
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   super.onCreateOptionsMenu(menu);
   getMenuInflater().inflate(R.menu.main, menu);
   mMediaRouteMenuItem = mCastManager.addMediaRouterButton(menu, R.id.media_route_menu_item);
   return true;
 }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    MenuInflater menuInflater = getMenuInflater();
    menuInflater.inflate(R.menu.summary, menu);

    return true;
  }
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   // TODO Auto-generated method stub
   super.onCreateOptionsMenu(menu);
   MenuInflater mi = getMenuInflater();
   mi.inflate(R.menu.main_menu, menu);
   return super.onCreateOptionsMenu(menu);
 }
Example #8
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   // Inflate the menu; this adds items to the action bar if it is present.
   getMenuInflater().inflate(R.menu.menu_main, menu);
   super.onCreateOptionsMenu(menu);
   this.menu = menu;
   updateMenuTitles();
   return true;
 }
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   super.onCreateOptionsMenu(menu);
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.run_map_pager_options, menu);
   // The menu has to be assigned to a member variable so we can alter the menu in
   // onPrepareOptionsMenu()
   mOptionsMenu = menu;
   return true;
 }
  /**
   * Create the option Menu's
   *
   * @see android.app.Activity#onCreateOptionsMenu(android.view.Menu)
   */
  public boolean onCreateOptionsMenu(Menu menu) {

    super.onCreateOptionsMenu(menu);
    menu.add(PREFERENCES_GROUP_ID, CALIBRATE_OPTION, 0, "CalibraciĆ³n")
        .setIcon(android.R.drawable.ic_menu_revert);
    menu.add(PREFERENCES_GROUP_ID, ABOUT_OPTION, 0, "Opciones")
        .setIcon(android.R.drawable.ic_menu_help);

    return true;
  }
Example #11
0
  /** Options Menu (Menu Button pressed) */
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);

    // inflate from xml
    MenuInflater inflater = new MenuInflater(this);
    inflater.inflate(R.menu.servers, menu);

    return true;
  }
Example #12
0
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    getMenuInflater().inflate(R.menu.activity_fragmenu, menu);

    if (isfrag1) {
      menu.findItem(R.id.frag1).setEnabled(false);
      menu.findItem(R.id.frag2).setEnabled(true);
    } else {
      menu.findItem(R.id.frag1).setEnabled(true);
      menu.findItem(R.id.frag2).setEnabled(false);
    }
    return true;
  }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);

    getMenuInflater().inflate(R.menu.menu_main, menu);
    menu.findItem(R.id.action_previous).setEnabled(viewPager.getCurrentItem() > 0);

    // Add either a "next" or "finish" button to the action bar, depending on which page
    // is currently selected.
    MenuItem item =
        menu.add(
            Menu.NONE,
            R.id.action_next,
            Menu.NONE,
            (viewPager.getCurrentItem() == myPagerAdapter.getCount() - 1)
                ? R.string.action_finish
                : R.string.action_next);
    item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
    return true;
  }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    getMenuInflater().inflate(R.menu.menu_info, menu);
    MenuItem menuItem = menu.findItem(R.id.action_search);
    SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();

    MenuItemCompat.setOnActionExpandListener(
        menuItem,
        new MenuItemCompat.OnActionExpandListener() {
          @Override
          public boolean onMenuItemActionCollapse(MenuItem item) {
            // Do something when collapsed
            getSupportFragmentManager().popBackStack();
            return true; // Return true to collapse action view
          }

          @Override
          public boolean onMenuItemActionExpand(MenuItem item) {
            // Do something when expanded
            getSupportFragmentManager()
                .beginTransaction()
                .add(R.id.container, petsListFragment)
                .addToBackStack("PetsListFragment")
                .commit();
            return true; // Return true to expand action view
          }
        });
    // Get the SearchView and set the searchable configuration
    // Assumes current activity is the searchable activity
    //        searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
    searchView.setIconifiedByDefault(true); // Do not iconify the widget; expand it by default
    searchView.setOnQueryTextListener(this);

    return true;
  }