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:cn.studyjams.s2.sj0132.bowenyan.mygirlfriend.nononsenseapps.notepad.ui.list.TaskListFragment.java

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

From source file:com.mifos.mifosxdroid.online.ClientDetailsFragment.java

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

From source file:gr.scify.newsum.ui.SearchViewActivity.java

public boolean onCreateOptionsMenu(Menu menu) {
    SharedPreferences userlang = getSharedPreferences("lang", 0);
    String newlang = userlang.getString("lang", Locale.getDefault().getLanguage());
    Setlanguage.updateLanguage(getApplicationContext(), newlang);

    MenuInflater inflater = getMenuInflater();

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

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {
        menu.findItem(R.id.share).setVisible(false);
    }//from   w w w.  ja  va 2 s . c o  m
    return true;

}

From source file:com.c4fcm.actionpath.MainActivity.java

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

}

From source file:net.reichholf.dreamdroid.fragment.TimerEditFragment.java

public void createOptionsMenu(Menu menu, MenuInflater inflater) {
    inflater.inflate(R.menu.cancel, menu);
}

From source file:com.dattasmoon.pebble.plugin.EditNotificationActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    MenuInflater menuInflater = getMenuInflater();
    menuInflater.inflate(R.menu.activity_edit_notifications, menu);
    if (mode == Mode.LOCALE) {
        menu.removeItem(R.id.btnSettings);
    }/*from w w  w  . j  a  v  a2  s. c o  m*/
    return true;
}

From source file:li.barter.fragments.AddOrEditBookFragment.java

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

From source file:com.example.mapdemo.BasicMapDemoActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.activity_map, menu);
    return true;//from  w w  w . ja va2 s .  com
}

From source file:android.com.example.contactslist.ui.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.contact_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);
}