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:in.shick.diode.reddits.PickSubredditActivity.java

/**
 * Populates the menu./*from  w  w w. j  av a 2s.c om*/
 */
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);

    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.subreddit_list, menu);
    return true;
}

From source file:de.stadtrallye.rallyesoft.MainActivity.java

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

    return true;//from   w w w.j av  a2 s.  c o  m
}

From source file:com.example.android.animationsdemo.ScreenSlideActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {

    //super.onCreateOptionsMenu(menu);
    // getMenuInflater().inflate(R.menu.activity_screen_slide, menu);

    // Add either a "next" or "finish" button to the action bar, depending on which page
    // is currently selected.
    /*/*from  w ww.ja  v  a 2s .  c o m*/
    MenuItem item = menu.add(Menu.NONE, R.id.action_next, Menu.NONE,
        (mPager.getCurrentItem() == mPagerAdapter.getCount() - 1)
                ? R.string.action_finish
                : R.string.action_next);
    item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);*/
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.activity_main_actions, menu);
    return super.onCreateOptionsMenu(menu);
    //return true;
}

From source file:fi.mikuz.boarder.gui.internet.Uploads.java

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

From source file:br.com.oficinatablet.chats.fragments.ChatSectionFragment.java

public View.OnClickListener getRowOptionListenerClick(final int positionRow, final Chat userModel) {
    return new View.OnClickListener() {
        @Override/*from   w w  w  .  j  av  a2s .c o  m*/
        public void onClick(View view) {
            PopupMenu popup = new PopupMenu(getActivity(), view);
            MenuInflater inflater = popup.getMenuInflater();
            inflater.inflate(R.menu.users_row, popup.getMenu());
            popup.show();
            setRowSelectedPosition(positionRow);
            setChatSelected(userModel);
        }
    };
}

From source file:br.com.oficinatablet.chats.fragments.ChatSectionFragment.java

public View.OnClickListener getRowOptionListenerClick(final int positionRow, final User userModel) {
    return new View.OnClickListener() {
        @Override/*from  ww  w  . j  a v  a 2 s  .  co m*/
        public void onClick(View view) {
            PopupMenu popup = new PopupMenu(getActivity(), view);
            MenuInflater inflater = popup.getMenuInflater();
            inflater.inflate(R.menu.users_row, popup.getMenu());
            popup.show();
            setRowSelectedPosition(positionRow);
            setUserSelected(userModel);
        }
    };
}

From source file:com.ternup.caddisfly.fragment.DetailsFragment.java

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

From source file:ca.ualberta.cmput301w14t08.geochan.fragments.ThreadListFragment.java

/**
 * Initialize's the ThreadList's menu./*from  w w w.  j  ava 2s  . co m*/
 * 
 * @param menu
 *            The Menu of the fragment.
 * @param inflater
 *            A MenuInflater to inflate the fragment's menu.
 */
@Override
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.thread_list, menu);
    MenuItem item = menu.findItem(R.id.action_settings);
    item.setVisible(true);
}

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

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

From source file:at.ac.tuwien.detlef.fragments.EpisodeListFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    MenuInflater inflater = getActivity().getMenuInflater();
    inflater.inflate(R.menu.episode_context, menu);

}