Example usage for android.view MenuInflater inflate

List of usage examples for android.view MenuInflater inflate

Introduction

In this page you can find the example usage for android.view MenuInflater inflate.

Prototype

public void inflate(@MenuRes int menuRes, Menu menu) 

Source Link

Document

Inflate a menu hierarchy from the specified XML resource.

Usage

From source file:com.vmihalachi.turboeditor.fragment.NavigationDrawerListFragment.java

/**
 * {@inheritDoc}//from w w w .  j  a  va2s  . c  o  m
 */
@Override
public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
    MenuInflater inflater = actionMode.getMenuInflater();
    inflater.inflate(R.menu.action_mode_navigation_drawer, menu);
    return true;
}

From source file:com.manning.androidhacks.hack040.ImageGridFragment.java

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

From source file:ch.ethz.twimight.activities.DmListActivity.java

@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
    MenuInflater inflater = mode.getMenuInflater();
    inflater.inflate(R.menu.dm_context, menu);
    return true;/*  ww  w .j  ava  2  s.c o m*/
}

From source file:com.example.android.sunshine.app.ForcastFragment.java

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

From source file:com.example.healthplus.wifidirect.WiFiDirectActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.action_items, menu);
    return true;/*from   w  ww . j a v  a  2  s.com*/
}

From source file:com.rei.lolchat.ui.Login.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.login, menu);
    return true;//  ww  w.  jav a2 s  .  c  o m
}

From source file:com.skalski.raspberrycontrol.Activity_GPIO.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater menuInflater = getMenuInflater();
    menuInflater.inflate(R.menu.menu_reconnect, menu);
    return true;/*from   w ww. j av  a  2 s  . c  om*/
}

From source file:at.flack.activity.NewFbContactActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.new_contact, menu);
    SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
    MenuItem searchMenuItem = menu.findItem(R.id.search);
    SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchMenuItem);
    searchView.setIconifiedByDefault(false);
    searchView.setIconified(false);//from  w w w.j  a  v a2  s.c om
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
    searchView.setSubmitButtonEnabled(true);
    searchView.setOnQueryTextListener(this);
    return true;
}

From source file:br.liveo.ndrawer.ui.fragment.FragmentContactus.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    // TODO Auto-generated method stub
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.menu_contactus, menu);

    //Select search item
    //  final MenuItem menuItem = menu.findItem(R.id.menu_search);
    //  menuItem.setVisible(true);

    //  SearchView searchView = (SearchView) menuItem.getActionView();
    // searchView.setQueryHint(this.getString(R.string.search));
    ///* w  w  w.j a v  a 2s.co  m*/
    //  ((EditText) searchView.findViewById(R.id.search_src_text))
    //        .setHintTextColor(getResources().getColor(R.color.nliveo_white));
    //  searchView.setOnQueryTextListener(onQuerySearchView);

    //   menu.findItem(R.id.menu_add).setVisible(true);

    //mSearchCheck = false;
}

From source file:com.facebook.samples.socialcafe.MenuFragmentActivity.java

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