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.illusor.swipeplayer.fragments.FolderBrowserFragment.java

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

From source file:org.onebusaway.android.ui.MyStarredStopsFragment.java

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

From source file:org.sensapp.android.sensappdroid.fragments.SensorListFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.add(0, MENU_DELETE_ID, 0, "Delete sensor");
    menu.add(0, MENU_UPLOAD_ID, 0, "Upload measures");
}

From source file:com.ratebeer.android.gui.fragments.CellarViewFragment.java

@SuppressWarnings("unchecked")
@Override//from   w w w  . j  a  va 2s. co  m
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    menu.add(Menu.NONE, MENU_REMOVE, MENU_REMOVE, R.string.cellar_remove);
    lastUsedListView = ((AdapterView<ListAdapter>) v).getAdapter();
}

From source file:liqui.droid.activity.InstanceListCached.java

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

From source file:org.whisperim.android.ui.ChatWindow.java

@Override
protected void onCreateContextMenu(ContextMenu menu) {
    super.onCreateContextMenu(menu);

    MenuItem sendKey = menu.add(0, SEND_KEY, 0, "Send Key");
    sendKey.setOnMenuItemClickListener(this);
    encryption_ = menu.add(0, ENCRYPTION, 0, "Encryption");
    encryption_.setOnMenuItemClickListener(this);
    encryption_.setCheckable(true);//  w  w  w  .j a  v  a2s . c o  m
    if (!parent_.haveKey(buddy_)) {
        encryption_.setEnabled(false);
    }

}

From source file:in.sundar.unitconverter.FormulaeListActivity.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.add(0, EDIT_ID, Menu.NONE, R.string.action_edit_formula);
    menu.add(0, DELETE_ID, Menu.NONE, R.string.action_delete_formula);
}

From source file:org.sufficientlysecure.keychain.ui.KeyListPublicFragment.java

/**
 * Context Menu on Long Click/*from   w  ww  .ja  v a 2  s  . c om*/
 */
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.add(0, Id.menu.update, 1, R.string.menu_updateKey);
    menu.add(0, Id.menu.signKey, 2, R.string.menu_signKey);
    menu.add(0, Id.menu.exportToServer, 3, R.string.menu_exportKeyToServer);
    menu.add(0, Id.menu.share, 6, R.string.menu_share);
    menu.add(0, Id.menu.share_qr_code, 7, R.string.menu_shareQrCode);
    menu.add(0, Id.menu.share_nfc, 8, R.string.menu_shareNfc);

}

From source file:org.totschnig.myexpenses.fragment.SplitPartList.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.add(0, R.id.DELETE_COMMAND, 0, R.string.menu_delete);
}

From source file:org.sensapp.android.sensappdroid.fragments.MeasureListFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.add(0, MENU_DELETE_ID, 0, R.string.menu_delete);
    menu.add(0, MENU_UPLOAD_ID, 0, "Upload measure");
}