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:nya.miku.wishmaster.ui.settings.AutohideActivity.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
    if (info.position == 0)
        return;/*from   www  .  jav  a 2 s.c  o m*/
    menu.add(Menu.NONE, R.id.context_menu_delete, 1, R.string.context_menu_delete_autohide_rule);
}

From source file:com.newcell.calltext.ui.messages.ConversationsListFragment.java

public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
    //        if (info.position > 0) {
    menu.add(0, MENU_VIEW, 0, R.string.menu_view);
    menu.add(0, MENU_DELETE, 0, R.string.menu_delete);
    //        }/*  w ww  .  ja va 2  s.com*/
}

From source file:can.yrt.onebusaway.MySearchStopsFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
    final TextView text = (TextView) info.targetView.findViewById(R.id.stop_name);
    menu.setHeaderTitle(text.getText());
    if (isShortcutMode()) {
        menu.add(0, CONTEXT_MENU_DEFAULT, 0, R.string.my_context_create_shortcut);
    } else {//  w  ww.j a v a2 s  .c o m
        menu.add(0, CONTEXT_MENU_DEFAULT, 0, R.string.my_context_get_stop_info);
    }
    menu.add(0, CONTEXT_MENU_SHOW_ON_MAP, 0, R.string.my_context_showonmap);
}

From source file:org.spinsuite.view.T_Menu.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    if (m_MenuType.equals(LookupMenu.MAIN_MENU)) {
        return;//  w  w  w . j av  a  2  s .  c  o  m
    }
    //   Standard Option
    menu.add(Menu.NONE, O_NO_FORCED, Menu.NONE, getString(R.string.Action_SyncNoForced));
    //   Forced Option
    menu.add(Menu.NONE, O_FORCED, Menu.NONE, getString(R.string.Action_SyncForced));
    //   Delete Before
    menu.add(Menu.NONE, O_DELETE_BEFORE, Menu.NONE, getString(R.string.Action_SyncDeleteBefore));
}

From source file:com.keepassdroid.fileselect.FileSelectActivity.java

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

    menu.add(0, CMENU_CLEAR, 0, R.string.remove_from_filelist);
}

From source file:com.chaosinmotion.securechat.activities.MainActivity.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    if (v.getId() == R.id.main_list) {
        String[] menuItems = getResources().getStringArray(R.array.context_menu);
        for (int i = 0; i < menuItems.length; ++i) {
            menu.add(Menu.NONE, i, i, menuItems[i]);
        }/*from ww w. j av a  2  s.  co  m*/
    }
}

From source file:com.dnielfe.manager.AppManager.java

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

    menu.setHeaderTitle(R.string.options);
    menu.add(0, ID_LAUNCH, 0, getString(R.string.launch));
    menu.add(0, ID_MANAGE, 0, getString(R.string.manage));
    menu.add(0, ID_UNINSTALL, 0, getString(R.string.uninstallapp));
    menu.add(0, ID_MARKET, 0, getString(R.string.playstore));
    menu.add(0, ID_SEND, 0, getString(R.string.share));
}

From source file:com.powermonitor.epitech.ConfigModules.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo info) {
    super.onCreateContextMenu(menu, v, info);
    AdapterView.AdapterContextMenuInfo minfo = (AdapterView.AdapterContextMenuInfo) info;
    Module r = adapter.getItem(minfo.position);
    _selectionPos = minfo.position;//  w  w w. j  a va 2s .  co m
    menu.setHeaderTitle(r.getName());
    menu.add(0, 0, 0, "Renommer");
    menu.add(0, 1, 0, "Changer le profil");
    menu.add(0, 2, 0, "Changer le profil interne");
}

From source file:com.csipsimple.ui.filters.AccountFiltersListFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    final long filterId = filterIdFromContextMenuInfo(menuInfo);
    if (filterId == -1) {
        return;//from ww  w.  j  a  va  2s.  co m
    }

    menu.add(0, MENU_ITEM_MODIFY, 0, R.string.edit);
    menu.add(0, MENU_ITEM_DELETE, 0, R.string.delete_filter);

}

From source file:org.ambientdynamix.core.HomeActivity.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.setHeaderTitle(R.string.app_list_contextmenu_title);
    menu.add(0, ENABLE_ID, 0, R.string.app_contextmenu_block);
    menu.add(0, DELETE_ID, 0, R.string.app_contextmenu_remove);
}