Example usage for android.view ContextMenu add

List of usage examples for android.view ContextMenu add

Introduction

In this page you can find the example usage for android.view ContextMenu add.

Prototype

public MenuItem add(int groupId, int itemId, int order, CharSequence title);

Source Link

Document

Add a new item to the menu.

Usage

From source file:net.ustyugov.jtalk.activity.muc.MucUsers.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo info) {
    menu.setHeaderTitle(R.string.Actions);
    menu.add(Menu.NONE, CONTEXT_EDIT, Menu.NONE, R.string.Edit);
    menu.add(Menu.NONE, CONTEXT_REMOVE, Menu.NONE, R.string.Remove);
    super.onCreateContextMenu(menu, v, info);
}

From source file:ua.com.spacetv.mycookbook.fragments.FragTopCategory.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    menu.add(0, ID_POPUP_ITEM_REN, 0, R.string.item_rename);
    menu.add(0, ID_POPUP_ITEM_DEL, 0, R.string.item_delete);
}

From source file:com.nttec.everychan.ui.FavoritesFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.add(Menu.NONE, R.id.context_menu_open_browser, 1, R.string.context_menu_open_browser);
    menu.add(Menu.NONE, R.id.context_menu_remove_favorites, 2, R.string.context_menu_remove_favorites);
}

From source file:com.csipsimple.ui.messages.MessageFragment.java

public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    menu.add(0, MENU_COPY, 0, R.string.copy_message_text);
}

From source file:com.sim2dial.dialer.ChatListFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.add(0, v.getId(), 0, getString(R.string.delete));
}

From source file:ua.com.spacetv.mycookbook.fragments.FragListRecipe.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    menu.add(0, ID_POPUP_ITEM_FAV, 0, R.string.item_favorite);
    menu.add(0, ID_POPUP_ITEM_REN, 0, R.string.item_rename);
    menu.add(0, ID_POPUP_ITEM_MOV, 0, R.string.item_move);
    menu.add(0, ID_POPUP_ITEM_DEL, 0, R.string.item_delete);
}

From source file:de.hshannover.f4.trust.ironcontrol.view.list_activities.ListSavedPublishsActivity.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.setHeaderTitle("Context Menu");
    menu.add(0, UPDATE_ID, 0, R.string.publish_update);
    menu.add(0, NOTIFY_ID, 0, R.string.publish_notify);
    menu.add(0, DELETE_ID, 0, R.string.publish_delete);
    menu.add(0, EDIT_ID, 0, R.string.edit);
    menu.add(0, REMOVE_ID, 0, R.string.remove);
}

From source file:pl.zajecia.cw3.PhotosActivity.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);

    menu.setHeaderTitle(R.string.image_options);
    menu.add(Menu.NONE, 0, Menu.NONE, R.string.remove_image);
}

From source file:org.totschnig.myexpenses.activity.ManageAccounts.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
    if (Account.count(null, null) > 1)
        menu.add(0, R.id.DELETE_COMMAND, 0, R.string.menu_delete);
    if (Transaction.countPerAccount(info.id) > 0)
        menu.add(0, R.id.RESET_ACCOUNT_COMMAND, 0, R.string.menu_reset);
    menu.add(0, R.id.EDIT_ACCOUNT_COMMAND, 0, R.string.menu_edit);
}

From source file:de.hshannover.f4.trust.ironcontrol.view.list_activities.ListOverviewActivity.java

@Override
protected void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo, ListHierarchyType type) {
    switch (type) {
    case SEARCH://from  www  . java  2s.com
        menu.add(0, SEARCH_ID, 0, R.string.string_search);
        break;
    case SUBSCRIPTION:
        menu.add(0, R.id.bSubscribeUpdate, 0, R.string.subscribeUpdate);
        menu.add(0, R.id.bSubscribeDelete, 0, R.string.subscribeDelete);
        break;
    }
    menu.add(0, EDIT_ID, 0, R.string.edit);
    menu.add(0, REMOVE_ID, 0, R.string.remove);
}