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

    android.view.MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.album_menu, menu);
  }
示例#2
0
  @Override
  public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);

    View target = ((AdapterContextMenuInfo) menuInfo).targetView;
    TextView from = (TextView) target.findViewById(R.id.chat_from);
    getMenuInflater().inflate(R.menu.chat_contextmenu, menu);
    if (!from.getText().equals(getString(R.string.chat_from_me))) {
      menu.findItem(R.id.chat_contextmenu_resend).setEnabled(false);
    }
  }
 @Override
 public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
   super.onCreateContextMenu(menu, v, menuInfo);
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.novel_context_menu, menu);
 }
 /**
  * A function to populate the context menu that is visible in the press long of a vehicle
  *
  * @param v the vehicle
  * @param menu the menu itself
  * @param menuInfo the information about the menu
  */
 @Override
 public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
   super.onCreateContextMenu(menu, v, menuInfo);
   menu.add(0, Menu.FIRST, 0, R.string.vehicle_edit);
   menu.add(0, Menu.FIRST + 1, 0, R.string.vehicle_delete);
 }