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:co.ldln.android.MainActivity.java

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

From source file:com.royclarkson.springagram.PhotoListFragment.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.photo_list_context_menu, menu);
}

From source file:android.example.com.visualizerpreferences.VisualizerActivity.java

/**
 * Methods for setting up the menu/* www.  j a  va2  s .c o  m*/
 **/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    /* Use AppCompatActivity's method getMenuInflater to get a handle on the menu inflater */
    MenuInflater inflater = getMenuInflater();
    /* Use the inflater's inflate method to inflate our visualizer_menu layout to this menu */
    inflater.inflate(R.menu.visualizer_menu, menu);
    /* Return true so that the visualizer_menu is displayed in the Toolbar */
    return true;
}

From source file:at.tugraz.ist.akm.activities.MainActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    if (Debug.isDebuggerConnected()) {
        UncaughtExceptionLogger exLogger = new UncaughtExceptionLogger(mLog);
        exLogger.register();//from  w ww. ja  va  2  s .  co  m
    }

    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.default_actionbar, menu);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    return true;
}

From source file:biz.incomsystems.fwknop2.ConfigListFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);

    MenuInflater inflater = this.getActivity().getMenuInflater();
    inflater.inflate(R.menu.list_longtap_menu, menu);
}

From source file:com.example.qrpoll.PollActivity.java

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

From source file:com.sudhirkhanger.app.popularmoviesstageone.TitlesFragment.java

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

From source file:com.activiti.android.app.fragments.process.ProcessesFragment.java

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

From source file:net.dahanne.spring.android.ch3.restful.example.recipeapp.RecipesList.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate menu from XML resource
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.list_options_menu, menu);

    Intent intent = new Intent(null, getIntent().getData());
    intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
    menu.addIntentOptions(Menu.CATEGORY_ALTERNATIVE, 0, 0, new ComponentName(this, RecipesList.class), null,
            intent, 0, null);//from  w ww  . ja  v  a2  s  . c  o m

    return super.onCreateOptionsMenu(menu);
}

From source file:com.adithya321.sharesanalysis.fragments.ShareSalesFragment.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    inflater.inflate(R.menu.share_sales, menu);
    actionProgressItem = menu.findItem(R.id.action_progress);
    actionRefreshItem = menu.findItem(R.id.action_refresh);
    actionProgressItem.setVisible(true);
    actionRefreshItem.setVisible(false);
    super.onCreateOptionsMenu(menu, inflater);
}