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.tt.jobtracker.MainActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    this.menu = menu;
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.menu_main, menu);

    // Associate searchable configuration with the SearchView
    SearchManager searchManager = (SearchManager) getSystemService(this.SEARCH_SERVICE);
    SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));

    /* ImageView tickImg=(ImageView) menu.findItem(R.id.action_task_done);
     if(Shared.SelectedTask!=null)/* w  w  w  .j a  v a  2 s . c  o  m*/
     {
    int value = dbHelper.PhotoUploadCount(Shared.SelectedTask.ID);
    if(value==0)
    {
        tickImg.setImageResource(R.drawable.done);
        tickImg.setFocusable(true);
        tickImg.setFocusableInTouchMode(true);
            
    }
    else
    {
        tickImg.setFocusable(false);
        tickImg.setFocusableInTouchMode(false);
        tickImg.setImageResource(R.drawable.ic_launcher);
    }
     }*/

    SetActionBarMenuItems();
    return super.onCreateOptionsMenu(menu);
}

From source file:activities.Activity_Main.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.activity_main, menu);
    return super.onCreateOptionsMenu(menu);
}

From source file:eu.intermodalics.tango_ros_streamer.activities.RunningActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.menu, menu);
    mToolbarMenu = menu;/*w w w  .java 2  s. c  om*/
    return true;
}

From source file:bikebadger.RideFragment.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.run_list_options, menu);
    mMenu = menu;// w w w.  j a v a  2 s  .c om
    mMenu.findItem(R.id.menu_item_gpx_save).setEnabled(false);
}

From source file:com.example.android.navigationdrawerexample.MainActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.main, menu);
    return super.onCreateOptionsMenu(menu);
}

From source file:net.bytten.comicviewer.ComicViewerActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.mainmenu, menu);
    menu.findItem(R.id.MENU_AUTHOR_LINK).setTitle(comicDef.getAuthorLinkText());
    return true;//  w w w  . j av  a2  s . c om
}

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

/**
 * {@inheritDoc}//from w  w w.ja v a  2 s  .c o m
 */
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    inflater.inflate(R.menu.fragment_editor, menu);
    menu.findItem(R.id.im_line_numbers).setChecked(this.sLineNumbers);
    menu.findItem(R.id.im_syntax_highlight).setChecked(this.sColorSyntax);
    menu.findItem(R.id.im_use_monospace).setChecked(this.mUseMonospace);
    super.onCreateOptionsMenu(menu, inflater);
}

From source file:com.money.manager.ex.home.HomeFragment.java

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

From source file:ee.ioc.phon.android.speak.RecognizerIntentActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    if (Log.DEBUG) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.recognizer, menu);
    }/*from   w w w . j  a  v a 2s. c o m*/
    return true;
}

From source file:br.com.mybaby.contatos.ContactDetailFragment.java

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

    // Inflates the options menu for this fragment
    inflater.inflate(R.menu.contatos_detail_menu, menu);

    // Gets a handle to the "find" menu item
    mEditContactMenuItem = menu.findItem(R.id.menu_edit_contact);

    // If contactUri is null the edit menu item should be hidden, otherwise
    // it is visible.
    mEditContactMenuItem.setVisible(mContactUri != null);
}