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.cloudkick.NodeViewActivity.java

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

From source file:com.activiti.android.app.fragments.task.TasksFragment.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    menu.clear();//from  www.jav  a 2 s.  c o  m
    inflater.inflate(R.menu.tasks, menu);
}

From source file:com.lovejoy777sarootool.rootool.fragments.BrowserFragment.java

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

    if (BrowserActivity.isDrawerOpen()) {
        menu.findItem(R.id.paste).setVisible(false);
        menu.findItem(R.id.folderinfo).setVisible(false);
        menu.findItem(R.id.search).setVisible(false);
    }/*from w  w w. ja  v  a  2s. c  o m*/

    MenuItem paste = menu.findItem(R.id.paste);
    paste.setVisible(!ClipBoard.isEmpty());
}

From source file:com.dwdesign.tweetings.fragment.ConversationFragment.java

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

From source file:de.Maxr1998.xposed.maxlock.ui.settings.appslist.AppsListFragment.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.applist_menu, menu);
    SearchView searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.toolbar_search));
    searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
        @Override/*from   w w  w .  j  a va 2  s  . c  o  m*/
        public boolean onQueryTextSubmit(String s) {
            return false;
        }

        @Override
        public boolean onQueryTextChange(String s) {
            mAdapter.getFilter().filter(s);
            return true;
        }
    });
}

From source file:chat.client.gui.ChatActivity.java

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

From source file:com.rvl.android.getnzb.LocalNZB.java

public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.localnzbcontextmenu, menu);
    super.onCreateContextMenu(menu, view, menuInfo);
}

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

public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    // Inflate the menu; this adds items to the action bar if it is present.
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.list_menu, menu);
}

From source file:com.clearcenter.mobile_demo.mdStatusActivity.java

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

    if (android.os.Build.VERSION.SDK_INT >= 11)
        inflater.inflate(R.menu.status_activity, menu);
    else/*from  ww  w  .j ava2 s.c  o m*/
        inflater.inflate(R.menu.status_activity_v7, menu);
    return true;
}

From source file:ch.gianulli.flashcards.BoardsFragment.java

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