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.android.dialer.calllog.CallLogActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    final MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.call_log_options, menu);
    return true;/*  ww w  .j av a 2 s  .  c  o  m*/
}

From source file:ca.rmen.android.scrumchatter.chart.MeetingChartFragment.java

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

From source file:circleplus.app.UserInfoFragment.java

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

From source file:de.lebenshilfe_muenster.uk_gebaerden_muensterland.sign_browser.search.SignSearchActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    Log.d(TAG, "onCreateOptionsMenu()" + this.hashCode());
    super.onCreateOptionsMenu(menu);
    final MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.options_sign_browser_search, menu);
    final SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
    final MenuItem searchItem = menu.findItem(R.id.action_search);
    final SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
    return true;// www.j av a 2 s. c  o m
}

From source file:com.abid_mujtaba.fetchheaders.AccountsActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater menuInflater = getMenuInflater();
    menuInflater.inflate(R.menu.accounts_menu, menu);

    MenuItem item = menu.findItem(R.id.menu_add_account); // We gain access to the menu item and through it to its action view (the actionLayout definied in the menu layout)
    View itemView = MenuItemCompat.getActionView(item);

    if (itemView != null) {
        itemView.setOnClickListener(new View.OnClickListener() { // To make the menu item work when it has an actionView we must explicitly attach a clicklistener to the actionview otherwise nothing happens when the menu is pressed
            @Override // Note: With this implementation we do NOT need an onOptionItemSelected method
            public void onClick(View view) {
                startActivity(new Intent("com.abid_mujtaba.fetchheaders.AccountSettingActivity"));
            }//  w w  w  .ja v a2 s.  com
        });
    }

    return true;
}

From source file:it.sasabz.android.sasabus.InfoActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.optionmenu, menu);
    return true;//  ww  w . j  a  v a 2s. c  om
}

From source file:co.nerdart.ourss.fragment.EntriesListFragment.java

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

    if (EntryColumns.FAVORITES_CONTENT_URI.equals(mUri)) {
        menu.findItem(R.id.menu_hide_read).setVisible(false);
    } else {// w  ww .  j ava 2s  .c o  m
        menu.findItem(R.id.menu_share_starred).setVisible(false);

        if (!PrefUtils.getBoolean(PrefUtils.SHOW_READ, true)) {
            menu.findItem(R.id.menu_hide_read).setTitle(R.string.context_menu_show_read)
                    .setIcon(R.drawable.view_reads);
        }
    }

    super.onCreateOptionsMenu(menu, inflater);
}

From source file:org.muckebox.android.ui.activity.WizardActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();

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

    mDoneItem = menu.findItem(R.id.wizard_action_done);
    mTestItem = menu.findItem(R.id.wizard_action_test);

    mDoneItem.setVisible(false);//from  w w w . j av a 2  s  .c om

    return super.onCreateOptionsMenu(menu);
}

From source file:com.messagesight.mqtthelper.PayloadViewer.java

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

}

From source file:com.adithya321.sharesanalysis.fragments.ShareHoldingsFragment.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);

    ProgressBar progressBar = (ProgressBar) actionProgressItem.getActionView()
            .findViewById(R.id.pbProgressAction);
    progressBar.getIndeterminateDrawable().setColorFilter(getResources().getColor(android.R.color.white),
            android.graphics.PorterDuff.Mode.SRC_IN);

    super.onCreateOptionsMenu(menu, inflater);
}