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:at.fjp.rightrack.SlidingTabs.SlidingTabsTodoFragment.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    menu.clear();//from ww  w .j  a  v a  2 s  . c om
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.main, menu);
}

From source file:br.com.GUI.perfil.MeuPersonal.java

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

}

From source file:bbct.android.common.activity.BaseballCardList.java

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

From source file:com.anadoluuniversity.tinyreader.OcrCaptureActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {

    if (getSupportFragmentManager().findFragmentByTag("FragmentCamera") != null
            && getSupportFragmentManager().findFragmentByTag("FragmentCamera").isVisible()) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.menu_search, menu);
        MenuItem item = menu.findItem(R.id.menuSearch);

        SearchView searchView = (SearchView) item.getActionView();

        searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
            @Override/*ww w.  j av  a2 s .c  o m*/
            public boolean onQueryTextSubmit(String query) {
                Log.d("searchbar_submit", query);
                wordToSearch = query;
                return false;
            }

            @Override
            public boolean onQueryTextChange(String newText) {
                return false;
            }
        });
    }

    return super.onCreateOptionsMenu(menu);
}

From source file:com.airflo.FlightListActivity.java

/**
 * Create the main menu/*from w  w w  .  ja  va2 s  .co m*/
 */
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.mainmenu, menu);
    return true;
}

From source file:com.android.bleserver.ScannerFragment.java

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

From source file:at.ac.tuwien.detlef.fragments.PodListFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    MenuInflater inflater = getActivity().getMenuInflater();
    inflater.inflate(R.menu.podcast_context, menu);
}

From source file:com.abs.telecam.gui.ControllerViewer.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    if (isGallery()) {
        inflater.inflate(R.menu.clear_cache, menu);
    }//from  ww w.ja va2s . co m
}

From source file:com.royclarkson.springagram.GalleryPhotoListFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    MenuInflater inflater = new MenuInflater(this.getActivity());
    inflater.inflate(R.menu.gallery_photo_list_context_menu, menu);
}

From source file:mad.codeforcommunity.CalendarView.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // TODO Auto-generated method stub
    super.onCreateOptionsMenu(menu);
    MenuInflater blowUp = getMenuInflater();
    blowUp.inflate(R.menu.activity_main, menu);
    return true;/*  ww  w .j  a va2  s. c  o m*/
}