/* Initiating Menu XML file (menu.xml) */
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);

    // inflater.inflate(R.layout.menu, menu);

  }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   this.menu = menu;
   inflater.inflate(R.menu.main_menu, menu);
   showOverflowMenu(false);
   super.onCreateOptionsMenu(menu, inflater);
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   // Inflate the menu; this adds items to the action bar if it is present.
   inflater.inflate(R.menu.solicitar_servicio_menu, menu);
   /*SolicitarServicio.this.getActivity().getMenuInflater().inflate(R.menu.solicitar_servicio_menu, menu);*/
   super.onCreateOptionsMenu(menu, inflater);
 }
 /**
  * Set Search in Action Bar
  *
  * @param menu
  * @param inflater
  */
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
   searchView.setIconifiedByDefault(true);
   searchView.setOnQueryTextListener(queryListener);
 }
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    menu.setGroupVisible(R.id.sortGroup, true);
    menu.findItem(R.id.search).setVisible(true);

    SearchManager searchManager =
        (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE);
    searchMenuItem = menu.findItem(R.id.search);
    searchView = (SearchView) MenuItemCompat.getActionView(searchMenuItem);
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getActivity().getComponentName()));
    searchView.setSubmitButtonEnabled(true);
    searchView.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
    searchView.setOnQueryTextListener(
        new SearchView.OnQueryTextListener() {
          @Override
          public boolean onQueryTextChange(String newText) {
            searchFilter(newText);
            return true;
          }

          @Override
          public boolean onQueryTextSubmit(String query) {
            InputMethodManager imm =
                (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
            return true;
          }
        });
    searchView.setOnFocusChangeListener(searchViewOnFocusChangeListener);
  }
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);

    // Inflate options menu.
    inflater.inflate(R.menu.accept_cancel_menu, menu);
  }
Beispiel #7
0
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   headerMenu = new MenuBuilder(context);
   inflater.inflate(R.menu.web_navigation, headerMenu);
   inflater.inflate(R.menu.feed, menu);
   super.onCreateOptionsMenu(menu, inflater);
 }
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflator) {
    if (menu.findItem(R.id.action_search) == null) {
      inflator.inflate(R.menu.menu_recyceler_view, menu);
    }

    SearchView search = (SearchView) menu.findItem(R.id.action_search).getActionView();
    if (search != null) {
      search.setOnQueryTextListener(
          new SearchView.OnQueryTextListener() {
            @Override
            public boolean onQueryTextSubmit(String query) {
              int position = soccerData.findFirst(query);
              if (position >= 0) mRecyclerView.smoothScrollToPosition(position);
              return true;
            }

            @Override
            public boolean onQueryTextChange(String query) {
              return true;
            }
          });
    }
    super.onCreateOptionsMenu(menu, inflator);
  }
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    for (int i = 0; i < items.length; i++) menu.add(0, i, i, items[i]);
    menu.setGroupCheckable(0, true, true);

    super.onCreateOptionsMenu(menu, inflater);
  }
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.search, menu);

    final android.support.v7.widget.SearchView searchView =
        (android.support.v7.widget.SearchView)
            MenuItemCompat.getActionView(menu.findItem(R.id.search));

    final MenuItem searchMenuItem = menu.findItem(R.id.search);

    searchView.setOnQueryTextFocusChangeListener(
        new View.OnFocusChangeListener() {

          @Override
          public void onFocusChange(View v, boolean hasFocus) {
            if (!hasFocus) {
              searchMenuItem.collapseActionView();
              searchView.setQuery("", false);
            }
          }
        });

    searchView.setOnQueryTextListener(
        new android.support.v7.widget.SearchView.OnQueryTextListener() {
          @Override
          public boolean onQueryTextChange(String newText) {

            textlength = newText.length();
            list.clear();

            for (int i = 0; i < str_title.length; i++) {
              if (textlength <= str_title[i].length()) {
                if (str_title[i].toLowerCase().contains(newText.toLowerCase())) {

                  ItemRecent objItem = new ItemRecent();

                  objItem.setCategoryName((str_cat_name[i]));
                  objItem.setCatId(str_cat_id[i]);
                  objItem.setCId(str_cid[i]);
                  objItem.setNewsDate(str_date[i]);
                  objItem.setNewsDescription(str_desc[i]);
                  objItem.setNewsHeading(str_title[i]);
                  objItem.setNewsImage(str_image[i]);
                  list.add(objItem);
                }
              }
            }

            setAdapterToListview();
            return false;
          }

          @Override
          public boolean onQueryTextSubmit(String query) {

            return true;
          }
        });
  }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   BaseApplication.getBus().post(new FragmentOnCreateOptionsMenuEvent());
   Timber.tag(TAG);
   Timber.d("onCreateOptionsMenu");
   initOnCreateOptionsMenuBody();
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   if (menu != null) { // Escondemos el añadir evento
     menu.setGroupVisible(R.id.tab_listaeventos_admin_group, false);
     menu.setGroupVisible(R.id.base_group, false);
   }
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   inflater.inflate(R.menu.map_fragment_menu, menu);
   MainActivity.mainActionBar.setTitle(getString(R.string.title_fragment_venue_list));
   MainActivity.mainActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
   MainActivity.mainActionBar.setHomeAsUpIndicator(R.drawable.ic_menu_white_24dp);
   super.onCreateOptionsMenu(menu, inflater);
 }
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {

    menu.clear();
    inflater.inflate(R.menu.menu_fragments, menu);

    super.onCreateOptionsMenu(menu, inflater);
  }
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.menu_basic, menu);

    menu.findItem(R.id.menu_notify).setVisible(true);
    menu.findItem(R.id.menu_sync).setVisible(true);
  }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   // Se infla el menú correspondiente.
   menu.clear(); // Para que no repita el menú de Tienda.
   inflater.inflate(R.menu.fragment_imagenes_lista, menu);
   mnuActualizar = menu.findItem(R.id.mnuActualizar);
   // Se indica que ya se ha procesado el evento.
   super.onCreateOptionsMenu(menu, inflater);
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   // 当抽屉打开时显示应用全局的actionbar设置
   if (mDrawerLayout != null && isDrawerOpen()) {
     inflater.inflate(R.menu.main, menu);
     showGlobalContextActionBar();
   }
   super.onCreateOptionsMenu(menu, inflater);
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   // TODO Auto-generated method stub
   inflater.inflate(R.menu.fragment_list_menu, menu);
   SearchView searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
   setupSearchView(searchView);
   refreshItem = menu.findItem(R.id.menu_refresh);
   super.onCreateOptionsMenu(menu, inflater);
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   if (mNumberOfCameras > 1) {
     // Inflate our menu which can gather user input for switching camera
     inflater.inflate(R.menu.camera_menu, menu);
   } else {
     super.onCreateOptionsMenu(menu, inflater);
   }
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   inflater.inflate(R.menu.menu_movie_detail, menu);
   // Locate MenuItem with ShareActionProvider
   shareMenuItem = menu.findItem(R.id.menu_share);
   mShareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(shareMenuItem);
   setShareIntent();
   super.onCreateOptionsMenu(menu, inflater);
 }
Beispiel #21
0
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    Fragment fragment = getFragment();
    if (fragment != null) fragment.onCreateOptionsMenu(menu, getMenuInflater());

    boolean created = super.onCreateOptionsMenu(menu);
    menuCreated = true;
    return created;
  }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   // If the drawer is open, show the global app actions in the action bar. See also
   // showGlobalContextActionBar, which controls the top-left area of the action bar.
   if (mDrawerLayout != null && isDrawerOpen()) {
     inflater.inflate(R.menu.global, menu);
     showGlobalContextActionBar();
   }
   super.onCreateOptionsMenu(menu, inflater);
 }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   if (!Utils.isTablet(getActivity())) {
     getActivity().getMenuInflater().inflate(R.menu.udobra_list, menu);
     MenuItem item = menu.findItem(R.id.action_fix_udobra);
     item.setVisible(false);
     UdobraList_fragment.item = item;
   }
   super.onCreateOptionsMenu(menu, inflater);
 }
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    inflater.inflate(R.menu.menu_recipe_details, menu);
    if (this.isSavedList) {
      MenuItem item = menu.findItem(R.id.action_save);
      item.setVisible(false);
    }

    super.onCreateOptionsMenu(menu, inflater);
  }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   inflater.inflate(R.menu.menu_select_program, menu);
   MenuItem item = menu.findItem(R.id.action_search);
   SearchView searchView = (SearchView) MenuItemCompat.getActionView(item);
   MenuItemCompat.setOnActionExpandListener(item, this);
   searchView.setOnQueryTextListener(this);
   searchView.setOnQueryTextFocusChangeListener(this);
 }
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);

    menu.findItem(R.id.action_gps).setVisible(false);
    menu.findItem(R.id.action_sync).setVisible(false);
    menu.findItem(R.id.action_refresh).setVisible(false);
    menu.findItem(R.id.action_getcatalogs).setVisible(true);
    menu.findItem(R.id.action_update).setVisible(true);
  }
  /** Populate the menu with the menu created in the resource files */
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.fragment_crime_list, menu);

    // Dealing with displaying number of crimes as a subtitle
    MenuItem subtitleItem = menu.findItem(R.id.fragment_crime_list_menu_item_show_subtitle);
    // depending on whether visible or not change the name
    if (mSubtitleVisible) subtitleItem.setTitle(R.string.hide_subtitles);
    else subtitleItem.setTitle(R.string.show_subtitle);
  }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   // Inflate the menu; this adds items to the action bar if it is present.
   inflater.inflate(R.menu.menu_detail, menu);
   // Retrieve the share menu item
   MenuItem menuItem = menu.findItem(R.id.action_share);
   // Get the provider and hold onto it to set/change the share intent.
   mShareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(menuItem);
   //        mShareActionProvider.setShareIntent(createShareVideoIntent(null));
   super.onCreateOptionsMenu(menu, inflater);
 }
  /**
   * Inflate our customized menu.
   *
   * @param menu
   * @param inflater
   */
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.fragment_crime_list, menu);

    MenuItem subtitleitem = menu.findItem(R.id.menu_item_show_subtitle);
    if (mSubtitleVisible) {
      subtitleitem.setTitle(R.string.hide_subtitle);
    } else {
      subtitleitem.setTitle(R.string.show_subtitle);
    }
  }
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {

    super.onCreateOptionsMenu(menu, inflater);

    inflater.inflate(R.menu.menu_timeline_fragment, menu);

    MenuItemCompat.setShowAsAction(
        menu.findItem(R.id.action_edit), MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
    MenuItemCompat.setShowAsAction(
        menu.findItem(R.id.action_refresh), MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
  }