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:ca.ualberta.cmput301w14t08.geochan.activities.MainActivity.java

/**
 * Inflates this activity's action bar options.
 * @param menu the menu/*from  w  w  w.ja  v a2s .  c  om*/
 * @return the result
 */
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.main, menu);
    return super.onCreateOptionsMenu(menu);
}

From source file:com.hybris.mobile.activity.StoreLocatorDetailActivity.java

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

    MenuItem geofenceItem = menu.findItem(R.id.geofence_store);

    // We display an active icon if there is a geofence for this store AND the geofencing functionnality is activated
    if (geofenceJsonSharedPreferences.getGeofenceObject(store.getName()) != null
            && Hybris.isGeofencingActivated()) {
        geofenceItem.setIcon(R.drawable.ic_menu_location_active);
    }// w  ww .  j av  a2 s  . c  o m
    // Otherwise we display the default icon
    else {
        geofenceItem.setIcon(R.drawable.ic_menu_location_default);
    }

    return true;
}

From source file:com.sakisds.icymonitor.fragments.NotificationsFragment.java

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

From source file:com.QuarkLabs.BTCeClient.fragments.HomeFragment.java

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

From source file:ca.ualberta.cmput301.t03.user.FriendsListFragment.java

/**
 * {@inheritDoc}//from   ww  w  .  j  a  v a2s  .  c o m
 */
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.fragment_friends_list, menu);
}

From source file:org.ubicompforall.cityexplorer.gui.PoiDetailsActivity.java

@Override
public boolean onPrepareOptionsMenu(Menu menu) {
    menu.clear();/*from   w w w .  ja v a  2 s .  com*/
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.poi_menu, menu);
    if (poi.isFavorite()) {
        menu.findItem(R.id.poiMenufavorite).setIcon(R.drawable.favstar_on);
    } else {
        menu.findItem(R.id.poiMenufavorite).setIcon(R.drawable.favstar_off);
    }
    return super.onPrepareOptionsMenu(menu);
}

From source file:com.f16gaming.pathofexilestatistics.MainActivity.java

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

From source file:ar.org.fsadosky.iptablesmanager.fragment.ApplicationsListFragment.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    // Inflate the menu; this adds items to the action bar if it is present.
    inflater.inflate(R.menu.menu_main, menu);
    // Retrieve the SearchView and plug it into SearchManager
    searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.action_search));
    searchView.setOnQueryTextListener(this);
}

From source file:com.gizwits.gizdataaccesssdkdemo.activitys.MainActivity.java

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

From source file:com.kii.world.MainActivity.java

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