public void onCreateContextMenu(ContextMenu menu) { super.onCreateContextMenu(menu); menu.setHeaderTitle("MyImage Menu"); menu.add(0, 100, 0, "이미지 회전"); menu.add(0, 101, 0, "크기 변경"); }
public void onCreateContextMenu( ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { final int position = ((AdapterView.AdapterContextMenuInfo) menuInfo).position; if (getItem(position) != null) { menu.setHeaderTitle(getItem(position).getText()); menu.add(0, OPEN_ITEM_ID, 0, myResource.getResource("open").getValue()); // menu.add(0, EDIT_ITEM_ID, 0, myResource.getResource("edit").getValue()); menu.add(0, DELETE_ITEM_ID, 0, myResource.getResource("delete").getValue()); } }
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); if (v == mBtn) { menu.setHeaderTitle("Button Menu"); menu.add(0, 1, 0, "Red"); menu.add(0, 2, 0, "Green"); menu.add(0, 3, 0, "Blue"); } if (v == mEdit) { menu.add(0, 4, 0, "번역하기"); menu.add(0, 5, 0, "필기 인식"); } }
@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo; getMenuInflater().inflate(R.menu.folder_context, menu); FolderInfoHolder folder = (FolderInfoHolder) mAdapter.getItem(info.position); menu.setHeaderTitle(folder.displayName); if (!folder.name.equals(mAccount.getTrashFolderName())) menu.findItem(R.id.empty_trash).setVisible(false); if (folder.name.equals(mAccount.getOutboxFolderName())) { menu.findItem(R.id.check_mail).setVisible(false); } else { menu.findItem(R.id.send_messages).setVisible(false); } if (K9.ERROR_FOLDER_NAME.equals(folder.name)) { menu.findItem(R.id.expunge).setVisible(false); } menu.setHeaderTitle(folder.displayName); }